Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 526b913

Browse files
committed
C++: Fix join orders.
1 parent cb47bdd commit 526b913

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,15 +1209,16 @@ private module Cached {
12091209
// the operand also flows to the indirction of the instruction.
12101210
exists(Operand operand, Instruction instr, int indirectionIndex |
12111211
simpleInstructionLocalFlowStep(operand, instr) and
1212-
hasOperandAndIndex(nodeFrom, operand, indirectionIndex) and
1213-
hasInstructionAndIndex(nodeTo, instr, indirectionIndex)
1212+
hasOperandAndIndex(nodeFrom, operand, pragma[only_bind_into](indirectionIndex)) and
1213+
hasInstructionAndIndex(nodeTo, instr, pragma[only_bind_into](indirectionIndex))
12141214
)
12151215
or
12161216
// If there's indirect flow to an operand, then there's also indirect
12171217
// flow to the operand after applying some pointer arithmetic.
12181218
exists(PointerArithmeticInstruction pointerArith, int indirectionIndex |
1219-
hasOperandAndIndex(nodeFrom, pointerArith.getAnOperand(), indirectionIndex) and
1220-
hasInstructionAndIndex(nodeTo, pointerArith, indirectionIndex)
1219+
hasOperandAndIndex(nodeFrom, pointerArith.getAnOperand(),
1220+
pragma[only_bind_into](indirectionIndex)) and
1221+
hasInstructionAndIndex(nodeTo, pointerArith, pragma[only_bind_into](indirectionIndex))
12211222
)
12221223
}
12231224

@@ -1229,8 +1230,8 @@ private module Cached {
12291230
exists(Operand operand, Instruction instr, int indirectionIndex |
12301231
simpleOperandLocalFlowStep(pragma[only_bind_into](instr), pragma[only_bind_into](operand))
12311232
|
1232-
hasOperandAndIndex(nodeTo, operand, indirectionIndex) and
1233-
hasInstructionAndIndex(nodeFrom, instr, indirectionIndex)
1233+
hasOperandAndIndex(nodeTo, operand, pragma[only_bind_into](indirectionIndex)) and
1234+
hasInstructionAndIndex(nodeFrom, instr, pragma[only_bind_into](indirectionIndex))
12341235
)
12351236
}
12361237

0 commit comments

Comments
 (0)