diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index 7b89e9714ff0..40740d956dcd 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -382,7 +382,7 @@ private class SideEffectArgumentNode extends ArgumentNode, SideEffectOperandNode exists(int indirectionIndex | pos = TIndirectionPosition(argumentIndex, pragma[only_bind_into](indirectionIndex)) and this.getCallInstruction() = dfCall.asCallInstruction() and - super.hasAddressOperandAndIndirectionIndex(_, pragma[only_bind_into](indirectionIndex)) + super.hasAddressOperandAndIndirectionIndex(arg, pragma[only_bind_into](indirectionIndex)) ) } } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll index 4dabd917b3d3..34401de1b127 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll @@ -757,9 +757,11 @@ class SsaIteratorNode extends Node, TSsaIteratorNode { class SideEffectOperandNode extends Node instanceof IndirectOperand { CallInstruction call; int argumentIndex; + ArgumentOperand arg; SideEffectOperandNode() { - IndirectOperand.super.hasOperandAndIndirectionIndex(call.getArgumentOperand(argumentIndex), _) + arg = call.getArgumentOperand(argumentIndex) and + IndirectOperand.super.hasOperandAndIndirectionIndex(arg, _) } CallInstruction getCallInstruction() { result = call }