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) {
267267 [
268268 instr .( LoadInstruction ) .getSourceAddressOperand ( ) ,
269269 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.
270273 instr .( ReferenceToInstruction ) .getSourceAddressOperand ( )
271274 ]
272275}
@@ -293,6 +296,8 @@ Operand getSourceValueOperand(Instruction instr) {
293296 or
294297 result = instr .( ReadSideEffectInstruction ) .getSideEffectOperand ( )
295298 or
299+ // See the comment on the `ReferenceToInstruction` disjunct in `getSourceAddressOperand` for why
300+ // this case is included.
296301 result = instr .( ReferenceToInstruction ) .getSourceValueOperand ( )
297302}
298303
You can’t perform that action at this time.
0 commit comments