mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
C++ IR: Fix calls to non-existent predicates
The last commit introduced calls to two predicates that did not exist. I created `Instruction.getResultAddress` so it now exists and changed the other call back to use the predicate that does exist.
This commit is contained in:
@@ -510,7 +510,7 @@ class Instruction extends Construction::TInstruction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the operand that holds the memory address to which the instruction stores its
|
||||
* Gets the operand that holds the memory address to which this instruction stores its
|
||||
* result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
|
||||
* is `r1`.
|
||||
*/
|
||||
@@ -519,6 +519,15 @@ class Instruction extends Construction::TInstruction {
|
||||
result.getUse() = this
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the instruction that holds the exact memory address to which this instruction stores its
|
||||
* result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
|
||||
* is the instruction that defines `r1`.
|
||||
*/
|
||||
final Instruction getResultAddress() {
|
||||
result = getResultAddressOperand().getDef()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the result of this instruction is precisely modeled in SSA. Always
|
||||
* holds for a register result. For a memory result, a modeled result is
|
||||
|
||||
@@ -21,7 +21,7 @@ private predicate hasResultMemoryAccess(Instruction instr, IRVariable var, Type
|
||||
|
||||
private predicate hasOperandMemoryAccess(MemoryOperand operand, IRVariable var, Type type, IntValue startBitOffset,
|
||||
IntValue endBitOffset) {
|
||||
resultPointsTo(operand.getAddress().getAnyDef(), var, startBitOffset) and
|
||||
resultPointsTo(operand.getAddressOperand().getAnyDef(), var, startBitOffset) and
|
||||
type = operand.getType() and
|
||||
if exists(operand.getSize()) then
|
||||
endBitOffset = Ints::add(startBitOffset, Ints::mul(operand.getSize(), 8))
|
||||
|
||||
@@ -510,7 +510,7 @@ class Instruction extends Construction::TInstruction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the operand that holds the memory address to which the instruction stores its
|
||||
* Gets the operand that holds the memory address to which this instruction stores its
|
||||
* result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
|
||||
* is `r1`.
|
||||
*/
|
||||
@@ -519,6 +519,15 @@ class Instruction extends Construction::TInstruction {
|
||||
result.getUse() = this
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the instruction that holds the exact memory address to which this instruction stores its
|
||||
* result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
|
||||
* is the instruction that defines `r1`.
|
||||
*/
|
||||
final Instruction getResultAddress() {
|
||||
result = getResultAddressOperand().getDef()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the result of this instruction is precisely modeled in SSA. Always
|
||||
* holds for a register result. For a memory result, a modeled result is
|
||||
|
||||
@@ -510,7 +510,7 @@ class Instruction extends Construction::TInstruction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the operand that holds the memory address to which the instruction stores its
|
||||
* Gets the operand that holds the memory address to which this instruction stores its
|
||||
* result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
|
||||
* is `r1`.
|
||||
*/
|
||||
@@ -519,6 +519,15 @@ class Instruction extends Construction::TInstruction {
|
||||
result.getUse() = this
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the instruction that holds the exact memory address to which this instruction stores its
|
||||
* result, if any. For example, in `m3 = Store r1, r2`, the result of `getResultAddressOperand()`
|
||||
* is the instruction that defines `r1`.
|
||||
*/
|
||||
final Instruction getResultAddress() {
|
||||
result = getResultAddressOperand().getDef()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the result of this instruction is precisely modeled in SSA. Always
|
||||
* holds for a register result. For a memory result, a modeled result is
|
||||
|
||||
Reference in New Issue
Block a user