Skip to content

Commit 5f470c3

Browse files
committed
fixup! C++: Move the 'getArgumentIndex' into the abstract 'Position' class. It is implemented in all subclasses anyway.
1 parent 1ba125a commit 5f470c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ private class ExplicitParameterInstructionNode extends AbstractExplicitParameter
14451445
ExplicitParameterInstructionNode() { exists(instr.getParameter()) }
14461446

14471447
override predicate isSourceParameterOf(Function f, ParameterPosition pos) {
1448-
f.getParameter(pos.(DirectPosition).getIndex()) = instr.getParameter()
1448+
f.getParameter(pos.(DirectPosition).getArgumentIndex()) = instr.getParameter()
14491449
}
14501450

14511451
override string toStringImpl() { result = instr.getParameter().toString() }
@@ -1460,7 +1460,7 @@ class ThisParameterInstructionNode extends AbstractExplicitParameterNode,
14601460
ThisParameterInstructionNode() { instr.getIRVariable() instanceof IRThisVariable }
14611461

14621462
override predicate isSourceParameterOf(Function f, ParameterPosition pos) {
1463-
pos.(DirectPosition).getIndex() = -1 and
1463+
pos.(DirectPosition).getArgumentIndex() = -1 and
14641464
instr.getEnclosingFunction() = f
14651465
}
14661466

@@ -1494,7 +1494,7 @@ private class DirectBodyLessParameterNode extends AbstractExplicitParameterNode,
14941494

14951495
override predicate isSourceParameterOf(Function f, ParameterPosition pos) {
14961496
this.getFunction() = f and
1497-
f.getParameter(pos.(DirectPosition).getIndex()) = p
1497+
f.getParameter(pos.(DirectPosition).getArgumentIndex()) = p
14981498
}
14991499

15001500
override Parameter getParameter() { result = p }

0 commit comments

Comments
 (0)