File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,9 @@ Operand getSourceAddressOperand(Instruction instr) {
267
267
[
268
268
instr .( LoadInstruction ) .getSourceAddressOperand ( ) ,
269
269
instr .( ReadSideEffectInstruction ) .getArgumentOperand ( ) ,
270
+ // `ReferenceToInstruction` is really more of an address-of operation,
271
+ // but by including it in this list we break out of `flowOutOfAddressStep` at an
272
+ // instruction that, at the source level, looks like a use of a variable.
270
273
instr .( ReferenceToInstruction ) .getSourceAddressOperand ( )
271
274
]
272
275
}
@@ -293,6 +296,8 @@ Operand getSourceValueOperand(Instruction instr) {
293
296
or
294
297
result = instr .( ReadSideEffectInstruction ) .getSideEffectOperand ( )
295
298
or
299
+ // See the comment on the `ReferenceToInstruction` disjunct in `getSourceAddressOperand` for why
300
+ // this case is included.
296
301
result = instr .( ReferenceToInstruction ) .getSourceValueOperand ( )
297
302
}
298
303
You can’t perform that action at this time.
0 commit comments