Skip to content

Commit 3c59aa3

Browse files
authored
Merge pull request #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

File tree

103 files changed

+478
-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.

103 files changed

+478
-450
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,9 @@ library class ExprEvaluator extends int {
626626
// All assignments must have the same int value
627627
result =
628628
unique(Expr value |
629-
value = v.getAnAssignedValue() and not ignoreVariableAssignment(e, v, value)
629+
value = v.getAnAssignedValue() and not this.ignoreVariableAssignment(e, v, value)
630630
|
631-
getValueInternalNonSubExpr(value)
631+
this.getValueInternalNonSubExpr(value)
632632
)
633633
)
634634
}

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
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ abstract class LeapYearFieldAccess extends YearFieldAccess {
156156
//
157157
// https://aa.usno.navy.mil/faq/docs/calendars.php
158158
this.isUsedInMod4Operation() and
159-
additionalModulusCheckForLeapYear(400) and
160-
additionalModulusCheckForLeapYear(100)
159+
this.additionalModulusCheckForLeapYear(400) and
160+
this.additionalModulusCheckForLeapYear(100)
161161
}
162162
}
163163

@@ -176,17 +176,17 @@ class StructTmLeapYearFieldAccess extends LeapYearFieldAccess {
176176

177177
override predicate isUsedInCorrectLeapYearCheck() {
178178
this.isUsedInMod4Operation() and
179-
additionalModulusCheckForLeapYear(400) and
180-
additionalModulusCheckForLeapYear(100) and
179+
this.additionalModulusCheckForLeapYear(400) and
180+
this.additionalModulusCheckForLeapYear(100) and
181181
// tm_year represents years since 1900
182182
(
183-
additionalAdditionOrSubstractionCheckForLeapYear(1900)
183+
this.additionalAdditionOrSubstractionCheckForLeapYear(1900)
184184
or
185185
// some systems may use 2000 for 2-digit year conversions
186-
additionalAdditionOrSubstractionCheckForLeapYear(2000)
186+
this.additionalAdditionOrSubstractionCheckForLeapYear(2000)
187187
or
188188
// converting from/to Unix epoch
189-
additionalAdditionOrSubstractionCheckForLeapYear(1970)
189+
this.additionalAdditionOrSubstractionCheckForLeapYear(1970)
190190
)
191191
}
192192
}

0 commit comments

Comments
 (0)