Skip to content

Commit a5efe9f

Browse files
committed
C++: Respond to review comments.
1 parent 7b8301a commit a5efe9f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasAnalysis.qll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,9 @@ private predicate resultEscapesNonReturn(Instruction instr) {
338338
not instr.isResultModeled()
339339
}
340340

341-
/** Holds if `operand` may (transitively) flow to an `AddressOperand` whose use is unmodeled. */
341+
/** Holds if `operand` may (transitively) flow to an `AddressOperand`. */
342342
private predicate consumedAsAddressOperand(Operand operand) {
343-
operand instanceof AddressOperand and
344-
exists(Instruction use | not use.isResultModeled())
343+
operand instanceof AddressOperand
345344
or
346345
exists(Operand address |
347346
consumedAsAddressOperand(address) and
@@ -351,7 +350,7 @@ private predicate consumedAsAddressOperand(Operand operand) {
351350

352351
/**
353352
* Holds if `operand` may originate from a base instruction of an allocation,
354-
* and that operand may transitively flow to an `AddressOperand` whose use is unmodeled.
353+
* and that operand may transitively flow to an `AddressOperand`.
355354
*/
356355
private predicate propagatedFromAllocationBase(Operand operand, Configuration::Allocation allocation) {
357356
consumedAsAddressOperand(operand) and

cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/AliasAnalysis.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ private predicate resultEscapesNonReturn(Instruction instr) {
340340

341341
/** Holds if `operand` may (transitively) flow to an `AddressOperand` whose use is unmodeled. */
342342
private predicate consumedAsAddressOperand(Operand operand) {
343-
operand instanceof AddressOperand and
344-
exists(Instruction use | not use.isResultModeled())
343+
exists(Instruction use | use = operand.(AddressOperand).getUse() and not use.isResultModeled())
345344
or
346345
exists(Operand address |
347346
consumedAsAddressOperand(address) and

0 commit comments

Comments
 (0)