Merge pull request #7245 from erik-krogh/explicit-this-all-the-places · koto/codeql@3c59aa3 · GitHub
Skip to content

Commit 3c59aa3

Browse files
authored
Merge pull request github#7245 from erik-krogh/explicit-this-all-the-places
All langs: apply the explicit-this patch to all remaining code
2 parents 4e68a46 + 74158f1 commit 3c59aa3

103 files changed

Lines changed: 478 additions & 450 deletions

File tree

Some content is hidden

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

‎cpp/ql/lib/semmle/code/cpp/controlflow/internal/ConstantExprs.qll‎

Lines changed: 2 additions & 2 deletions

‎cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ class SsaPhiNode extends Node, TSsaPhiNode {
452452

453453
/** Holds if this phi node has input from the `rnk`'th write operation in block `block`. */
454454
final predicate hasInputAtRankInBlock(IRBlock block, int rnk) {
455-
hasInputAtRankInBlock(block, rnk, _)
455+
this.hasInputAtRankInBlock(block, rnk, _)
456456
}
457457

458458
/**

‎cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Operand.qll‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOpe
307307
final override string toString() { result = tag.toString() }
308308

309309
final override Instruction getAnyDef() {
310-
result = unique(Instruction defInstr | hasDefinition(defInstr, _))
310+
result = unique(Instruction defInstr | this.hasDefinition(defInstr, _))
311311
}
312312

313313
final override Overlap getDefinitionOverlap() { this.hasDefinition(_, result) }

‎cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Operand.qll‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOpe
307307
final override string toString() { result = tag.toString() }
308308

309309
final override Instruction getAnyDef() {
310-
result = unique(Instruction defInstr | hasDefinition(defInstr, _))
310+
result = unique(Instruction defInstr | this.hasDefinition(defInstr, _))
311311
}
312312

313313
final override Overlap getDefinitionOverlap() { this.hasDefinition(_, result) }

‎cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Operand.qll‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOpe
307307
final override string toString() { result = tag.toString() }
308308

309309
final override Instruction getAnyDef() {
310-
result = unique(Instruction defInstr | hasDefinition(defInstr, _))
310+
result = unique(Instruction defInstr | this.hasDefinition(defInstr, _))
311311
}
312312

313313
final override Overlap getDefinitionOverlap() { this.hasDefinition(_, result) }

‎cpp/ql/src/AlertSuppression.ql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ class SuppressionComment extends Comment {
1818
(
1919
this instanceof CppStyleComment and
2020
// strip the beginning slashes
21-
text = getContents().suffix(2)
21+
text = this.getContents().suffix(2)
2222
or
2323
this instanceof CStyleComment and
2424
// strip both the beginning /* and the end */ the comment
2525
exists(string text0 |
26-
text0 = getContents().suffix(2) and
26+
text0 = this.getContents().suffix(2) and
2727
text = text0.prefix(text0.length() - 2)
2828
) and
2929
// The /* */ comment must be a single-line comment

‎cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.ql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ class ExtClass extends Class {
153153
}
154154

155155
predicate hasLocationInfo(string path, int startline, int startcol, int endline, int endcol) {
156-
if hasOneVariableGroup()
156+
if this.hasOneVariableGroup()
157157
then
158158
exists(VariableDeclarationGroup vdg | vdg.getClass() = this |
159159
vdg.hasLocationInfo(path, startline, startcol, endline, endcol)
160160
)
161-
else getLocation().hasLocationInfo(path, startline, startcol, endline, endcol)
161+
else this.getLocation().hasLocationInfo(path, startline, startcol, endline, endcol)
162162
}
163163
}
164164

‎cpp/ql/src/Critical/OverflowStatic.ql‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ class CallWithBufferSize extends FunctionCall {
103103
// `upperBound(e)` defaults to `exprMaxVal(e)` when `e` isn't analyzable. So to get a meaningful
104104
// result in this case we pick the minimum value obtainable from dataflow and range analysis.
105105
result =
106-
upperBound(statedSizeExpr())
106+
upperBound(this.statedSizeExpr())
107107
.minimum(min(Expr statedSizeSrc |
108-
DataFlow::localExprFlow(statedSizeSrc, statedSizeExpr())
108+
DataFlow::localExprFlow(statedSizeSrc, this.statedSizeExpr())
109109
|
110110
statedSizeSrc.getValue().toInt()
111111
))

‎cpp/ql/src/JPL_C/LOC-2/Rule 09/Semaphores.qll‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ abstract class LockOperation extends FunctionCall {
2222
ControlFlowNode getAReachedNode() {
2323
result = this
2424
or
25-
exists(ControlFlowNode mid | mid = getAReachedNode() |
25+
exists(ControlFlowNode mid | mid = this.getAReachedNode() |
2626
not mid != this.getMatchingUnlock() and
2727
result = mid.getASuccessor()
2828
)

‎cpp/ql/src/Likely Bugs/Leap Year/LeapYear.qll‎

Lines changed: 7 additions & 7 deletions

0 commit comments

Comments
 (0)