Skip to content

Commit e89e0eb

Browse files
committed
make some acronyms camelCase
1 parent 0ac8b7c commit e89e0eb

File tree

93 files changed

+762
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+762
-450
lines changed

cpp/ql/lib/semmle/code/cpp/XML.qll

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ class XmlFile extends XmlParent, File {
132132
XmlElement getARootElement() { result = this.getAChild() }
133133

134134
/** Gets a DTD associated with this XML file. */
135-
XmlDTD getADTD() { xmlDTDs(result, _, _, _, this) }
135+
XmlDtd getADtd() { xmlDTDs(result, _, _, _, this) }
136+
137+
/** DEPRECATED: Alias for getADtd */
138+
deprecated XmlDTD getADTD() { result = getADtd() }
136139
}
137140

138141
/** DEPRECATED: Alias for XmlFile */
@@ -149,7 +152,7 @@ deprecated class XMLFile = XmlFile;
149152
* <!ELEMENT lastName (#PCDATA)>
150153
* ```
151154
*/
152-
class XmlDTD extends XmlLocatable, @xmldtd {
155+
class XmlDtd extends XmlLocatable, @xmldtd {
153156
/** Gets the name of the root element of this DTD. */
154157
string getRoot() { xmlDTDs(this, result, _, _, _) }
155158

@@ -174,7 +177,10 @@ class XmlDTD extends XmlLocatable, @xmldtd {
174177
}
175178
}
176179

177-
/** DEPRECATED: Alias for XmlDTD */
180+
/** DEPRECATED: Alias for XmlDtd */
181+
deprecated class XmlDTD = XmlDtd;
182+
183+
/** DEPRECATED: Alias for XmlDtd */
178184
deprecated class XMLDTD = XmlDTD;
179185

180186
/**
@@ -282,15 +288,18 @@ class XmlNamespace extends XmlLocatable, @xmlnamespace {
282288
string getPrefix() { xmlNs(this, result, _, _) }
283289

284290
/** Gets the URI of this namespace. */
285-
string getURI() { xmlNs(this, _, result, _) }
291+
string getUri() { xmlNs(this, _, result, _) }
292+
293+
/** DEPRECATED: Alias for getUri */
294+
deprecated string getURI() { result = getUri() }
286295

287296
/** Holds if this namespace has no prefix. */
288297
predicate isDefault() { this.getPrefix() = "" }
289298

290299
override string toString() {
291-
this.isDefault() and result = this.getURI()
300+
this.isDefault() and result = this.getUri()
292301
or
293-
not this.isDefault() and result = this.getPrefix() + ":" + this.getURI()
302+
not this.isDefault() and result = this.getPrefix() + ":" + this.getUri()
294303
}
295304
}
296305

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasedSSA.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import semmle.code.cpp.ir.internal.Overlap
33
private import semmle.code.cpp.ir.internal.IRCppLanguage as Language
44
private import semmle.code.cpp.Print
55
private import semmle.code.cpp.ir.implementation.unaliased_ssa.IR
6-
private import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.SSAConstruction as OldSSA
6+
private import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.SSAConstruction as OldSsa
77
private import semmle.code.cpp.ir.internal.IntegerConstant as Ints
88
private import semmle.code.cpp.ir.internal.IntegerInterval as Interval
99
private import semmle.code.cpp.ir.implementation.internal.OperandTag
@@ -572,7 +572,7 @@ private Overlap getVariableMemoryLocationOverlap(
572572
* Holds if the def/use information for the result of `instr` can be reused from the previous
573573
* iteration of the IR.
574574
*/
575-
predicate canReuseSsaForOldResult(Instruction instr) { OldSSA::canReuseSsaForMemoryResult(instr) }
575+
predicate canReuseSsaForOldResult(Instruction instr) { OldSsa::canReuseSsaForMemoryResult(instr) }
576576

577577
/** DEPRECATED: Alias for canReuseSsaForOldResult */
578578
deprecated predicate canReuseSSAForOldResult = canReuseSsaForOldResult/1;

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ private import Imports::OperandTag
55
private import Imports::Overlap
66
private import Imports::TInstruction
77
private import Imports::RawIR as RawIR
8-
private import SSAInstructions
9-
private import SSAOperands
8+
private import SsaInstructions
9+
private import SsaOperands
1010
private import NewIR
1111

1212
private class OldBlock = Reachability::ReachableBlock;

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstructionInternal.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as OldIR
22
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.reachability.ReachableBlock as Reachability
33
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.reachability.Dominance as Dominance
44
import semmle.code.cpp.ir.implementation.aliased_ssa.IR as NewIR
5-
import semmle.code.cpp.ir.implementation.internal.TInstruction::AliasedSsaInstructions as SSAInstructions
5+
import semmle.code.cpp.ir.implementation.internal.TInstruction::AliasedSsaInstructions as SsaInstructions
6+
7+
/** DEPRECATED: Alias for SsaInstructions */
8+
deprecated module SSAInstructions = SsaInstructions;
9+
610
import semmle.code.cpp.ir.internal.IRCppLanguage as Language
711
import AliasedSSA as Alias
8-
import semmle.code.cpp.ir.implementation.internal.TOperand::AliasedSsaOperands as SSAOperands
12+
import semmle.code.cpp.ir.implementation.internal.TOperand::AliasedSsaOperands as SsaOperands
13+
14+
/** DEPRECATED: Alias for SsaOperands */
15+
deprecated module SSAOperands = SsaOperands;

cpp/ql/lib/semmle/code/cpp/ir/implementation/internal/TInstruction.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ newtype TInstruction =
2929
UnaliasedSsa::SSA::hasUnreachedInstruction(irFunc)
3030
} or
3131
TAliasedSsaPhiInstruction(
32-
TRawInstruction blockStartInstr, AliasedSSA::SSA::MemoryLocation memoryLocation
32+
TRawInstruction blockStartInstr, AliasedSsa::SSA::MemoryLocation memoryLocation
3333
) {
34-
AliasedSSA::SSA::hasPhiInstruction(blockStartInstr, memoryLocation)
34+
AliasedSsa::SSA::hasPhiInstruction(blockStartInstr, memoryLocation)
3535
} or
3636
TAliasedSsaChiInstruction(TRawInstruction primaryInstruction) {
37-
AliasedSSA::SSA::hasChiInstruction(primaryInstruction)
37+
AliasedSsa::SSA::hasChiInstruction(primaryInstruction)
3838
} or
3939
TAliasedSsaUnreachedInstruction(IRFunctionBase irFunc) {
40-
AliasedSSA::SSA::hasUnreachedInstruction(irFunc)
40+
AliasedSsa::SSA::hasUnreachedInstruction(irFunc)
4141
}
4242

4343
/**
@@ -83,7 +83,7 @@ module AliasedSsaInstructions {
8383
class TPhiInstruction = TAliasedSsaPhiInstruction or TUnaliasedSsaPhiInstruction;
8484

8585
TPhiInstruction phiInstruction(
86-
TRawInstruction blockStartInstr, AliasedSSA::SSA::MemoryLocation memoryLocation
86+
TRawInstruction blockStartInstr, AliasedSsa::SSA::MemoryLocation memoryLocation
8787
) {
8888
result = TAliasedSsaPhiInstruction(blockStartInstr, memoryLocation)
8989
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import semmle.code.cpp.ir.internal.IRCppLanguage as Language
22
import semmle.code.cpp.ir.implementation.raw.internal.IRConstruction as IRConstruction
33
import semmle.code.cpp.ir.implementation.unaliased_ssa.internal.SSAConstruction as UnaliasedSsa
4-
import semmle.code.cpp.ir.implementation.aliased_ssa.internal.SSAConstruction as AliasedSSA
4+
import semmle.code.cpp.ir.implementation.aliased_ssa.internal.SSAConstruction as AliasedSsa
5+
6+
/** DEPRECATED: Alias for AliasedSsa */
7+
deprecated module AliasedSSA = AliasedSsa;

cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ private import Imports::OperandTag
55
private import Imports::Overlap
66
private import Imports::TInstruction
77
private import Imports::RawIR as RawIR
8-
private import SSAInstructions
9-
private import SSAOperands
8+
private import SsaInstructions
9+
private import SsaOperands
1010
private import NewIR
1111

1212
private class OldBlock = Reachability::ReachableBlock;

cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstructionInternal.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ import semmle.code.cpp.ir.implementation.raw.internal.reachability.ReachableBloc
33
import semmle.code.cpp.ir.implementation.raw.internal.reachability.Dominance as Dominance
44
import semmle.code.cpp.ir.implementation.unaliased_ssa.IR as NewIR
55
import semmle.code.cpp.ir.implementation.raw.internal.IRConstruction as RawStage
6-
import semmle.code.cpp.ir.implementation.internal.TInstruction::UnaliasedSsaInstructions as SSAInstructions
6+
import semmle.code.cpp.ir.implementation.internal.TInstruction::UnaliasedSsaInstructions as SsaInstructions
7+
8+
/** DEPRECATED: Alias for SsaInstructions */
9+
deprecated module SSAInstructions = SsaInstructions;
10+
711
import semmle.code.cpp.ir.internal.IRCppLanguage as Language
812
import SimpleSSA as Alias
9-
import semmle.code.cpp.ir.implementation.internal.TOperand::UnaliasedSsaOperands as SSAOperands
13+
import semmle.code.cpp.ir.implementation.internal.TOperand::UnaliasedSsaOperands as SsaOperands
14+
15+
/** DEPRECATED: Alias for SsaOperands */
16+
deprecated module SSAOperands = SsaOperands;

cpp/ql/src/Security/CWE/CWE-295/SSLResultConflation.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import semmle.code.cpp.dataflow.DataFlow
1717
/**
1818
* A call to `SSL_get_verify_result`.
1919
*/
20-
class SSLGetVerifyResultCall extends FunctionCall {
21-
SSLGetVerifyResultCall() { getTarget().getName() = "SSL_get_verify_result" }
20+
class SslGetVerifyResultCall extends FunctionCall {
21+
SslGetVerifyResultCall() { getTarget().getName() = "SSL_get_verify_result" }
2222
}
2323

2424
/**
@@ -29,7 +29,7 @@ class VerifyResultConfig extends DataFlow::Configuration {
2929
VerifyResultConfig() { this = "VerifyResultConfig" }
3030

3131
override predicate isSource(DataFlow::Node source) {
32-
source.asExpr() instanceof SSLGetVerifyResultCall
32+
source.asExpr() instanceof SslGetVerifyResultCall
3333
}
3434

3535
override predicate isSink(DataFlow::Node sink) {

cpp/ql/src/Security/CWE/CWE-295/SSLResultNotChecked.ql

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ import semmle.code.cpp.controlflow.IRGuards
1717
/**
1818
* A call to `SSL_get_peer_certificate`.
1919
*/
20-
class SSLGetPeerCertificateCall extends FunctionCall {
21-
SSLGetPeerCertificateCall() {
20+
class SslGetPeerCertificateCall extends FunctionCall {
21+
SslGetPeerCertificateCall() {
2222
getTarget().getName() = "SSL_get_peer_certificate" // SSL_get_peer_certificate(ssl)
2323
}
2424

25-
Expr getSSLArgument() { result = getArgument(0) }
25+
Expr getSslArgument() { result = getArgument(0) }
2626
}
2727

2828
/**
2929
* A call to `SSL_get_verify_result`.
3030
*/
31-
class SSLGetVerifyResultCall extends FunctionCall {
32-
SSLGetVerifyResultCall() {
31+
class SslGetVerifyResultCall extends FunctionCall {
32+
SslGetVerifyResultCall() {
3333
getTarget().getName() = "SSL_get_verify_result" // SSL_get_peer_certificate(ssl)
3434
}
3535

36-
Expr getSSLArgument() { result = getArgument(0) }
36+
Expr getSslArgument() { result = getArgument(0) }
3737
}
3838

3939
/**
4040
* Holds if the SSL object passed into `SSL_get_peer_certificate` is checked with
4141
* `SSL_get_verify_result` entering `node`.
4242
*/
43-
predicate resultIsChecked(SSLGetPeerCertificateCall getCertCall, ControlFlowNode node) {
44-
exists(Expr ssl, SSLGetVerifyResultCall check |
45-
ssl = globalValueNumber(getCertCall.getSSLArgument()).getAnExpr() and
46-
ssl = check.getSSLArgument() and
43+
predicate resultIsChecked(SslGetPeerCertificateCall getCertCall, ControlFlowNode node) {
44+
exists(Expr ssl, SslGetVerifyResultCall check |
45+
ssl = globalValueNumber(getCertCall.getSslArgument()).getAnExpr() and
46+
ssl = check.getSslArgument() and
4747
node = check
4848
)
4949
}
@@ -53,7 +53,7 @@ predicate resultIsChecked(SSLGetPeerCertificateCall getCertCall, ControlFlowNode
5353
* `0` on the edge `node1` to `node2`.
5454
*/
5555
predicate certIsZero(
56-
SSLGetPeerCertificateCall getCertCall, ControlFlowNode node1, ControlFlowNode node2
56+
SslGetPeerCertificateCall getCertCall, ControlFlowNode node1, ControlFlowNode node2
5757
) {
5858
exists(Expr cert | cert = globalValueNumber(getCertCall).getAnExpr() |
5959
exists(GuardCondition guard, Expr zero |
@@ -87,7 +87,7 @@ predicate certIsZero(
8787
* `SSL_get_verify_result` at `node`. Note that this is only computed at the call to
8888
* `SSL_get_peer_certificate` and at the start and end of `BasicBlock`s.
8989
*/
90-
predicate certNotChecked(SSLGetPeerCertificateCall getCertCall, ControlFlowNode node) {
90+
predicate certNotChecked(SslGetPeerCertificateCall getCertCall, ControlFlowNode node) {
9191
// cert is not checked at the call to `SSL_get_peer_certificate`
9292
node = getCertCall
9393
or
@@ -112,7 +112,7 @@ predicate certNotChecked(SSLGetPeerCertificateCall getCertCall, ControlFlowNode
112112
)
113113
}
114114

115-
from SSLGetPeerCertificateCall getCertCall, ControlFlowNode node
115+
from SslGetPeerCertificateCall getCertCall, ControlFlowNode node
116116
where
117117
certNotChecked(getCertCall, node) and
118118
node instanceof Function // (function exit)

0 commit comments

Comments
 (0)