Skip to content

Commit 9a88e38

Browse files
authored
Merge pull request #20327 from michaelnebel/go/ql4ql
Go: Fix some Ql4Ql violations.
2 parents 39d3741 + 55e5281 commit 9a88e38

File tree

3 files changed

+163
-174
lines changed

3 files changed

+163
-174
lines changed

go/ql/lib/semmle/go/StringOps.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,12 @@ module StringOps {
306306
*/
307307
class StringFormatCall extends DataFlow::CallNode {
308308
string fmt;
309-
Range f;
310309

311310
StringFormatCall() {
312-
this = f.getACall() and
313-
fmt = this.getArgument(f.getFormatStringIndex()).getStringValue() and
311+
exists(Range f |
312+
this = f.getACall() and
313+
fmt = this.getArgument(f.getFormatStringIndex()).getStringValue()
314+
) and
314315
fmt.regexpMatch(getFormatComponentRegex() + "*")
315316
}
316317

go/ql/lib/semmle/go/dataflow/internal/DataFlowUtil.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
367367
}
368368

369369
/**
370-
* Holds if `guard` marks a point in the control-flow graph where this node
370+
* Holds if `guard` marks a point in the control-flow graph where `g`
371371
* is known to validate `nd`, which is represented by `ap`.
372372
*
373373
* This predicate exists to enforce a good join order in `getAGuardedNode`.
@@ -378,7 +378,7 @@ module BarrierGuard<guardChecksSig/3 guardChecks> {
378378
}
379379

380380
/**
381-
* Holds if `guard` marks a point in the control-flow graph where this node
381+
* Holds if `guard` marks a point in the control-flow graph where `g`
382382
* is known to validate `nd`.
383383
*/
384384
private predicate guards(Node g, ControlFlow::ConditionGuardNode guard, Node nd) {

0 commit comments

Comments
 (0)