Skip to content

Commit 0e09694

Browse files
committed
C++: Ensure that 'argumentOf' does not map to multiple argument positions.
1 parent 9970f78 commit 0e09694

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,11 @@ private class PrimaryArgumentNode extends ArgumentNode, OperandNode {
379379

380380
private class SideEffectArgumentNode extends ArgumentNode, SideEffectOperandNode {
381381
override predicate argumentOf(DataFlowCall dfCall, ArgumentPosition pos) {
382-
exists(int indirectionIndex |
382+
exists(int indirectionIndex, ArgumentOperand arg |
383383
pos = TIndirectionPosition(argumentIndex, pragma[only_bind_into](indirectionIndex)) and
384384
this.getCallInstruction() = dfCall.asCallInstruction() and
385-
super.hasAddressOperandAndIndirectionIndex(_, pragma[only_bind_into](indirectionIndex))
385+
arg = call.getArgumentOperand(argumentIndex) and
386+
super.hasAddressOperandAndIndirectionIndex(arg, pragma[only_bind_into](indirectionIndex))
386387
)
387388
}
388389
}

0 commit comments

Comments
 (0)