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 8730027ae45..6c949a024bb 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 @@ -1209,15 +1209,16 @@ private module Cached { // the operand also flows to the indirction of the instruction. exists(Operand operand, Instruction instr, int indirectionIndex | simpleInstructionLocalFlowStep(operand, instr) and - hasOperandAndIndex(nodeFrom, operand, indirectionIndex) and - hasInstructionAndIndex(nodeTo, instr, indirectionIndex) + hasOperandAndIndex(nodeFrom, operand, pragma[only_bind_into](indirectionIndex)) and + hasInstructionAndIndex(nodeTo, instr, pragma[only_bind_into](indirectionIndex)) ) or // If there's indirect flow to an operand, then there's also indirect // flow to the operand after applying some pointer arithmetic. exists(PointerArithmeticInstruction pointerArith, int indirectionIndex | - hasOperandAndIndex(nodeFrom, pointerArith.getAnOperand(), indirectionIndex) and - hasInstructionAndIndex(nodeTo, pointerArith, indirectionIndex) + hasOperandAndIndex(nodeFrom, pointerArith.getAnOperand(), + pragma[only_bind_into](indirectionIndex)) and + hasInstructionAndIndex(nodeTo, pointerArith, pragma[only_bind_into](indirectionIndex)) ) } @@ -1229,8 +1230,8 @@ private module Cached { exists(Operand operand, Instruction instr, int indirectionIndex | simpleOperandLocalFlowStep(pragma[only_bind_into](instr), pragma[only_bind_into](operand)) | - hasOperandAndIndex(nodeTo, operand, indirectionIndex) and - hasInstructionAndIndex(nodeFrom, instr, indirectionIndex) + hasOperandAndIndex(nodeTo, operand, pragma[only_bind_into](indirectionIndex)) and + hasInstructionAndIndex(nodeFrom, instr, pragma[only_bind_into](indirectionIndex)) ) }