Skip to content

Commit d325082

Browse files
committed
C++: Fix another place that assumed that 'Expr' was always 'Instruction'.
1 parent 6e38105 commit d325082

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cpp/ql/src/experimental/Likely Bugs/OverrunWriteProductFlow.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import DataFlow::PathGraph
2424

2525
pragma[nomagic]
2626
Instruction getABoundIn(SemBound b, IRFunction func) {
27-
result = b.getExpr(0) and
27+
getSemanticExpr(result) = b.getExpr(0) and
2828
result.getEnclosingIRFunction() = func
2929
}
3030

@@ -110,7 +110,7 @@ class StringSizeConfiguration extends ProductFlow::Configuration {
110110
state1 = s1.toString() and
111111
state2 = s2.toString() and
112112
add.hasOperands(node1.asOperand(), op) and
113-
semBounded(op.getDef(), any(SemZeroBound zero), delta, true, _) and
113+
semBounded(getSemanticExpr(op.getDef()), any(SemZeroBound zero), delta, true, _) and
114114
node2.asInstruction() = add and
115115
s1 = s2 + delta
116116
)

cpp/ql/src/experimental/Security/CWE/CWE-193/ConstantSizeArrayOffByOne.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import PointerArithmeticToDerefFlow::PathGraph
1919

2020
pragma[nomagic]
2121
Instruction getABoundIn(SemBound b, IRFunction func) {
22-
result = b.getExpr(0) and
22+
getSemanticExpr(result) = b.getExpr(0) and
2323
result.getEnclosingIRFunction() = func
2424
}
2525

cpp/ql/src/experimental/Security/CWE/CWE-193/InvalidPointerDeref.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import semmle.code.cpp.ir.IR
2424

2525
pragma[nomagic]
2626
Instruction getABoundIn(SemBound b, IRFunction func) {
27-
result = b.getExpr(0) and
27+
getSemanticExpr(result) = b.getExpr(0) and
2828
result.getEnclosingIRFunction() = func
2929
}
3030

0 commit comments

Comments
 (0)