Skip to content

Commit 6d87c05

Browse files
jbjdave-bartolomeo
andauthored
Apply suggestions from code review
Co-Authored-By: Dave Bartolomeo <42150477+dave-bartolomeo@users.noreply.github.com>
1 parent 2111bf5 commit 6d87c05

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/internal/AliasedSSA.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private class IntValue = Ints::IntValue;
1111

1212
private predicate hasResultMemoryAccess(Instruction instr, IRVariable var, Type type, IntValue startBitOffset,
1313
IntValue endBitOffset) {
14-
resultPointsTo(instr.getResultAddressOperand().getAnyDef(), var, startBitOffset) and
14+
resultPointsTo(instr.getResultAddress(), var, startBitOffset) and
1515
type = instr.getResultType() and
1616
if exists(instr.getResultSize()) then
1717
endBitOffset = Ints::add(startBitOffset, Ints::mul(instr.getResultSize(), 8))
@@ -21,7 +21,7 @@ private predicate hasResultMemoryAccess(Instruction instr, IRVariable var, Type
2121

2222
private predicate hasOperandMemoryAccess(MemoryOperand operand, IRVariable var, Type type, IntValue startBitOffset,
2323
IntValue endBitOffset) {
24-
resultPointsTo(operand.getAddressOperand().getAnyDef(), var, startBitOffset) and
24+
resultPointsTo(operand.getAddress().getAnyDef(), var, startBitOffset) and
2525
type = operand.getType() and
2626
if exists(operand.getSize()) then
2727
endBitOffset = Ints::add(startBitOffset, Ints::mul(operand.getSize(), 8))

cpp/ql/src/semmle/code/cpp/rangeanalysis/RangeUtils.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ IntValue getConstantValue(Instruction instr) {
2222
result = getConstantValue(instr.(CopyInstruction).getSourceValue()) or
2323
exists(PhiInstruction phi |
2424
phi = instr and
25-
result = max(PhiInputOperand operand | operand = phi.getAnOperand() | getConstantValue(operand.getAnyDef())) and
26-
result = min(PhiInputOperand operand | operand = phi.getAnOperand() | getConstantValue(operand.getAnyDef()))
25+
result = max(PhiInputOperand operand | operand = phi.getAnOperand() | getConstantValue(operand.getDef())) and
26+
result = min(PhiInputOperand operand | operand = phi.getAnOperand() | getConstantValue(operand.getDef()))
2727
)
2828
}
2929

@@ -35,7 +35,7 @@ predicate valueFlowStep(Instruction i, Operand op, int delta) {
3535
i.(AddInstruction).getAnOperand() = x and
3636
op != x
3737
|
38-
delta = getValue(getConstantValue(x.getAnyDef()))
38+
delta = getValue(getConstantValue(x.getDef()))
3939
)
4040
or
4141
exists(Operand x |

cpp/ql/src/semmle/code/cpp/rangeanalysis/SignAnalysis.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ private predicate binaryOpSigns(BinaryInstruction i, Sign lhs, Sign rhs) {
331331
}
332332

333333
private Sign unguardedOperandSign(Operand operand) {
334-
result = instructionSign(operand.getAnyDef()) and
334+
result = instructionSign(operand.getDef()) and
335335
not hasGuard(operand, result)
336336
}
337337

338338
private Sign guardedOperandSign(Operand operand) {
339-
result = instructionSign(operand.getAnyDef()) and
339+
result = instructionSign(operand.getDef()) and
340340
hasGuard(operand, result)
341341
}
342342

0 commit comments

Comments
 (0)