diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll index 2fb3edad602..f2cafede5fe 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll @@ -753,11 +753,21 @@ class ReturnValueInstruction extends ReturnInstruction { */ final LoadOperand getReturnValueOperand() { result = getAnOperand() } + /** + * Gets the operand that provides the address of the value being returned by the function. + */ + final AddressOperand getReturnAddressOperand() { result = this.getAnOperand() } + /** * Gets the instruction whose result provides the value being returned by the function, if an * exact definition is available. */ - final Instruction getReturnValue() { result = getReturnValueOperand().getDef() } + final Instruction getReturnValue() { result = this.getReturnValueOperand().getDef() } + + /** + * Gets the instruction whose result provides the address of the value being returned by the function. + */ + final Instruction getReturnAddress() { result = this.getReturnAddressOperand().getDef() } } /**