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

Skip to content

Commit bccd4e9

Browse files
committed
C++: Add 'getReturnAddress' and 'getReturnAddressOperand' predicates to 'ReturnValueInstruction'.
1 parent 5b13232 commit bccd4e9

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,21 @@ class ReturnValueInstruction extends ReturnInstruction {
753753
*/
754754
final LoadOperand getReturnValueOperand() { result = getAnOperand() }
755755

756+
/**
757+
* Gets the operand that provides the address of the value being returned by the function.
758+
*/
759+
final AddressOperand getReturnAddressOperand() { result = this.getAnOperand() }
760+
756761
/**
757762
* Gets the instruction whose result provides the value being returned by the function, if an
758763
* exact definition is available.
759764
*/
760-
final Instruction getReturnValue() { result = getReturnValueOperand().getDef() }
765+
final Instruction getReturnValue() { result = this.getReturnValueOperand().getDef() }
766+
767+
/**
768+
* Gets the instruction whose result provides the address of the value being returned by the function.
769+
*/
770+
final Instruction getReturnAddress() { result = this.getReturnAddressOperand().getDef() }
761771
}
762772

763773
/**

0 commit comments

Comments
 (0)