Skip to content

Commit 6e61b1d

Browse files
C++: Fix up after merge from master
The one interesting piece that needed to be fixed up was the type of an `Indirect[Read|Write]SideEffect` operand/result. If the parameter type is a pointer or reference to an incomplete type, we need to set the type of the side effect memory access to `Unknown`, because we don't model incomplete types in the IR type system. I also added minimal support for `__assume` (generated as a `NoOp`), because lack of `__assume` support got in the way of debugging the other issue above.
1 parent 167d228 commit 6e61b1d

File tree

9 files changed

+93
-45
lines changed

9 files changed

+93
-45
lines changed

cpp/ql/src/semmle/code/cpp/exprs/Expr.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,13 @@ class ErrorExpr extends Expr, @errorexpr {
540540
*/
541541
class AssumeExpr extends Expr, @assume {
542542
override string toString() { result = "__assume(...)" }
543+
544+
override string getCanonicalQLClass() { result = "AssumeExpr" }
545+
546+
/**
547+
* Gets the operand of the `__assume` expressions.
548+
*/
549+
Expr getOperand() { this.hasChild(result, 0) }
543550
}
544551

545552
/**

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,17 @@ class TranslatedSideEffects extends TranslatedElement, TTranslatedSideEffects {
340340
)
341341
}
342342

343-
override predicate hasInstruction(Opcode opcode, InstructionTag tag, Type t, boolean isGLValue) {
344-
none()
345-
}
343+
override predicate hasInstruction(Opcode opcode, InstructionTag tag, CppType type) { none() }
346344

347345
override Instruction getFirstInstruction() { result = getChild(0).getFirstInstruction() }
348346

349347
override Instruction getInstructionSuccessor(InstructionTag tag, EdgeKind kind) { none() }
350348

351349
override Instruction getInstructionOperand(InstructionTag tag, OperandTag operandTag) { none() }
352350

353-
override Type getInstructionOperandType(InstructionTag tag, TypedOperandTag operandTag) { none() }
351+
override CppType getInstructionOperandType(InstructionTag tag, TypedOperandTag operandTag) {
352+
none()
353+
}
354354

355355
/**
356356
* Gets the `TranslatedFunction` containing this expression.
@@ -397,34 +397,30 @@ class TranslatedSideEffect extends TranslatedElement, TTranslatedArgumentSideEff
397397

398398
override Instruction getFirstInstruction() { result = getInstruction(OnlyInstructionTag()) }
399399

400-
override predicate hasInstruction(Opcode opcode, InstructionTag tag, Type t, boolean isGLValue) {
400+
override predicate hasInstruction(Opcode opcode, InstructionTag tag, CppType type) {
401401
isWrite() and
402402
hasSpecificWriteSideEffect(opcode) and
403403
tag = OnlyInstructionTag() and
404404
(
405405
opcode instanceof BufferAccessOpcode and
406-
t instanceof UnknownType
406+
type = getUnknownType()
407407
or
408408
not opcode instanceof BufferAccessOpcode and
409-
(
410-
t = arg.getUnspecifiedType().(DerivedType).getBaseType() and
411-
not t instanceof VoidType
412-
or
413-
arg.getUnspecifiedType().(DerivedType).getBaseType() instanceof VoidType and
414-
t instanceof UnknownType
409+
exists(Type baseType | baseType = arg.getUnspecifiedType().(DerivedType).getBaseType() |
410+
if baseType instanceof VoidType
411+
then type = getUnknownType()
412+
else type = getTypeForPRValueOrUnknown(baseType)
415413
)
416414
or
417415
index = -1 and
418416
not arg.getUnspecifiedType() instanceof DerivedType and
419-
t = arg.getUnspecifiedType()
420-
) and
421-
isGLValue = false
417+
type = getTypeForPRValueOrUnknown(arg.getUnspecifiedType())
418+
)
422419
or
423420
not isWrite() and
424421
hasSpecificReadSideEffect(opcode) and
425422
tag = OnlyInstructionTag() and
426-
t instanceof VoidType and
427-
isGLValue = false
423+
type = getVoidType()
428424
}
429425

430426
override Instruction getInstructionSuccessor(InstructionTag tag, EdgeKind kind) {
@@ -450,15 +446,20 @@ class TranslatedSideEffect extends TranslatedElement, TTranslatedArgumentSideEff
450446
.getFullyConverted()).getResult()
451447
}
452448

453-
override Type getInstructionOperandType(InstructionTag tag, TypedOperandTag operandTag) {
454-
tag instanceof OnlyInstructionTag and
455-
result = arg.getType().getUnspecifiedType().(DerivedType).getBaseType() and
456-
operandTag instanceof SideEffectOperandTag
457-
or
458-
tag instanceof OnlyInstructionTag and
459-
result = arg.getType().getUnspecifiedType() and
460-
not result instanceof DerivedType and
461-
operandTag instanceof SideEffectOperandTag
449+
override CppType getInstructionOperandType(InstructionTag tag, TypedOperandTag operandTag) {
450+
exists(Type operandType |
451+
tag instanceof OnlyInstructionTag and
452+
operandType = arg.getType().getUnspecifiedType().(DerivedType).getBaseType() and
453+
operandTag instanceof SideEffectOperandTag
454+
or
455+
tag instanceof OnlyInstructionTag and
456+
operandType = arg.getType().getUnspecifiedType() and
457+
not operandType instanceof DerivedType and
458+
operandTag instanceof SideEffectOperandTag |
459+
// If the type we select is an incomplete type (e.g. a forward-declared `struct`), there will
460+
// not be a `CppType` that represents that type. In that case, fall back to `UnknownCppType`.
461+
result = getTypeForPRValueOrUnknown(operandType)
462+
)
462463
}
463464

464465
predicate hasSpecificWriteSideEffect(Opcode op) {

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ private predicate ignoreExprAndDescendants(Expr expr) {
4949
// constant value.
5050
isIRConstant(getRealParent(expr))
5151
or
52+
// Ignore descendants of `__assume` expressions, since we translated these to `NoOp`.
53+
getRealParent(expr) instanceof AssumeExpr
54+
or
5255
// The `DestructorCall` node for a `DestructorFieldDestruction` has a `FieldAccess`
5356
// node as its qualifier, but that `FieldAccess` does not have a child of its own.
5457
// We'll ignore that `FieldAccess`, and supply the receiver as part of the calling

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,3 +2409,26 @@ class TranslatedErrorExpr extends TranslatedSingleInstructionExpr {
24092409

24102410
final override Opcode getOpcode() { result instanceof Opcode::Error }
24112411
}
2412+
2413+
/**
2414+
* The IR translation of an `__assume` expression. We currently translate these as `NoOp`. In the
2415+
* future, we will probably want to do something better. At a minimum, we can model `__assume(0)` as
2416+
* `Unreached`.
2417+
*/
2418+
class TranslatedAssumeExpr extends TranslatedSingleInstructionExpr {
2419+
override AssumeExpr expr;
2420+
2421+
final override Opcode getOpcode() { result instanceof Opcode::NoOp }
2422+
2423+
final override Instruction getFirstInstruction() { result = getInstruction(OnlyInstructionTag()) }
2424+
2425+
final override TranslatedElement getChild(int id) { none() }
2426+
2427+
final override Instruction getInstructionSuccessor(InstructionTag tag, EdgeKind kind) {
2428+
tag = OnlyInstructionTag() and
2429+
result = getParent().getChildSuccessor(this) and
2430+
kind instanceof GotoEdge
2431+
}
2432+
2433+
final override Instruction getChildSuccessor(TranslatedElement child) { none() }
2434+
}

cpp/ql/src/semmle/code/cpp/ir/internal/CppType.qll

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ private int getTypeSizeWorkaround(Type type) {
2121
else result = any(NullPointerType t).getSize()
2222
)
2323
)
24+
or
25+
exists(ArrayType arrayType |
26+
// Treat `T[]` as `T*`.
27+
arrayType = unspecifiedType and
28+
not arrayType.hasArraySize() and
29+
result = any(NullPointerType t).getSize()
30+
)
2431
)
2532
)
2633
}
@@ -88,7 +95,11 @@ predicate hasFloatingPointType(int byteSize) {
8895
private predicate isPointerIshType(Type type) {
8996
type instanceof PointerType or
9097
type instanceof ReferenceType or
91-
type instanceof NullPointerType
98+
type instanceof NullPointerType or
99+
// Treat `T[]` as a pointer. The only place we should see these is as the type of a parameter. If
100+
// the corresponding decayed `T*` type is available, we'll use that, but if it's not available,
101+
// we're stuck with `T[]`. Just treat it as a pointer.
102+
type instanceof ArrayType and not exists(type.getSize())
92103
}
93104

94105
/**
@@ -147,7 +158,7 @@ private IRType getIRTypeForPRValue(Type type) {
147158
isSignedIntegerType(unspecifiedType) and result.(IRSignedIntegerType).getByteSize() = type.getSize() or
148159
isUnsignedIntegerType(unspecifiedType) and result.(IRUnsignedIntegerType).getByteSize() = type.getSize() or
149160
unspecifiedType instanceof FloatingPointType and result.(IRFloatingPointType).getByteSize() = type.getSize() or
150-
isPointerIshType(unspecifiedType) and result.(IRAddressType).getByteSize() = type.getSize() or
161+
isPointerIshType(unspecifiedType) and result.(IRAddressType).getByteSize() = getTypeSize(type) or
151162
unspecifiedType instanceof FunctionPointerIshType and result.(IRFunctionAddressType).getByteSize() = getTypeSize(type) or
152163
unspecifiedType instanceof VoidType and result instanceof IRVoidType or
153164
unspecifiedType instanceof ErroneousType and result instanceof IRErrorType or
@@ -343,6 +354,15 @@ CppType getTypeForPRValue(Type type) {
343354
else result.hasType(type, false)
344355
}
345356

357+
/**
358+
* Gets the `CppType` that represents a prvalue of type `type`, if such a `CppType` exists.
359+
* Otherwise, gets `CppUnknownType`.
360+
*/
361+
CppType getTypeForPRValueOrUnknown(Type type) {
362+
result = getTypeForPRValue(type) or
363+
not exists(getTypeForPRValue(type)) and result = getUnknownType()
364+
}
365+
346366
/**
347367
* Gets the `CppType` that represents a glvalue of type `type`.
348368
*/

cpp/ql/test/library-tests/syntax-zoo/aliased_ssa_sanity.expected

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@ missingPhiOperand
1212
missingOperandType
1313
instructionWithoutSuccessor
1414
| VacuousDestructorCall.cpp:2:29:2:29 | InitializeParameter: y |
15-
| assume0.cpp:7:2:7:2 | Chi: call to f |
1615
| condition_decls.cpp:16:19:16:20 | Chi: call to BoxedInt |
1716
| condition_decls.cpp:26:23:26:24 | Chi: call to BoxedInt |
1817
| condition_decls.cpp:41:22:41:23 | Chi: call to BoxedInt |
1918
| condition_decls.cpp:48:52:48:53 | Chi: call to BoxedInt |
2019
| cpp17.cpp:15:11:15:21 | Convert: (void *)... |
21-
| misc.c:171:10:171:13 | VariableAddress: definition of str2 |
20+
| misc.c:171:10:171:13 | Uninitialized: definition of str2 |
2221
| misc.c:219:47:219:48 | InitializeParameter: sp |
2322
| ms_try_except.cpp:3:9:3:9 | Uninitialized: definition of x |
2423
| ms_try_mix.cpp:11:12:11:15 | Chi: call to C |
2524
| ms_try_mix.cpp:28:12:28:15 | Chi: call to C |
2625
| ms_try_mix.cpp:48:10:48:13 | Chi: call to C |
2726
| pointer_to_member.cpp:36:11:36:30 | FieldAddress: {...} |
2827
| stmt_expr.cpp:27:5:27:15 | Store: ... = ... |
29-
| vla.c:5:9:5:14 | VariableAddress: definition of matrix |
28+
| vla.c:5:9:5:14 | Uninitialized: definition of matrix |
3029
| vla.c:11:6:11:16 | UnmodeledDefinition: vla_typedef |
3130
ambiguousSuccessors
3231
| allocators.cpp:14:5:14:8 | UnmodeledDefinition: main | Goto | 4 | allocators.cpp:16:8:16:10 | VariableAddress: definition of foo |

cpp/ql/test/library-tests/syntax-zoo/raw_sanity.expected

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ missingOperand
88
| misc.c:220:9:223:3 | FieldAddress: {...} | Instruction 'FieldAddress' is missing an expected operand with tag 'Unary' in function '$@'. | misc.c:219:5:219:26 | IR: assign_designated_init | int assign_designated_init(someStruct*) |
99
| misc.c:220:9:223:3 | FieldAddress: {...} | Instruction 'FieldAddress' is missing an expected operand with tag 'Unary' in function '$@'. | misc.c:219:5:219:26 | IR: assign_designated_init | int assign_designated_init(someStruct*) |
1010
| pointer_to_member.cpp:36:13:36:19 | FieldAddress: x1 | Instruction 'FieldAddress' is missing an expected operand with tag 'Unary' in function '$@'. | pointer_to_member.cpp:32:6:32:14 | IR: pmIsConst | void pmIsConst() |
11+
| pointer_to_member.cpp:36:22:36:28 | Store: f1 | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | pointer_to_member.cpp:32:6:32:14 | IR: pmIsConst | void pmIsConst() |
1112
| range_analysis.c:368:10:368:21 | Store: ... ? ... : ... | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | range_analysis.c:355:14:355:27 | IR: test_ternary01 | unsigned int test_ternary01(unsigned int) |
1213
| range_analysis.c:369:10:369:36 | Store: ... ? ... : ... | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | range_analysis.c:355:14:355:27 | IR: test_ternary01 | unsigned int test_ternary01(unsigned int) |
1314
| range_analysis.c:370:10:370:38 | Store: ... ? ... : ... | Instruction 'Store' is missing an expected operand with tag 'StoreValue' in function '$@'. | range_analysis.c:355:14:355:27 | IR: test_ternary01 | unsigned int test_ternary01(unsigned int) |
@@ -24,8 +25,6 @@ instructionWithoutSuccessor
2425
| VacuousDestructorCall.cpp:2:29:2:29 | InitializeParameter: y |
2526
| VacuousDestructorCall.cpp:3:3:3:3 | VariableAddress: x |
2627
| VacuousDestructorCall.cpp:4:3:4:3 | Load: y |
27-
| assume0.cpp:7:2:7:2 | CallSideEffect: call to f |
28-
| assume0.cpp:9:11:9:11 | Constant: (bool)... |
2928
| condition_decls.cpp:16:19:16:20 | CallSideEffect: call to BoxedInt |
3029
| condition_decls.cpp:26:19:26:20 | IndirectMayWriteSideEffect: bi |
3130
| condition_decls.cpp:26:23:26:24 | CallSideEffect: call to BoxedInt |
@@ -35,19 +34,16 @@ instructionWithoutSuccessor
3534
| file://:0:0:0:0 | CompareNE: (bool)... |
3635
| file://:0:0:0:0 | CompareNE: (bool)... |
3736
| file://:0:0:0:0 | CompareNE: (bool)... |
38-
| misc.c:171:10:171:13 | VariableAddress: definition of str2 |
37+
| misc.c:171:10:171:13 | Uninitialized: definition of str2 |
3938
| misc.c:171:15:171:31 | Add: ... + ... |
40-
| misc.c:173:10:173:12 | VariableAddress: definition of buf |
4139
| misc.c:173:14:173:26 | Mul: ... * ... |
4240
| misc.c:173:37:173:39 | Store: array to pointer conversion |
43-
| misc.c:174:10:174:15 | VariableAddress: definition of matrix |
4441
| misc.c:174:17:174:22 | CallSideEffect: call to getInt |
4542
| misc.c:174:30:174:35 | CallSideEffect: call to getInt |
4643
| misc.c:174:55:174:60 | Store: (char ****)... |
4744
| misc.c:219:47:219:48 | InitializeParameter: sp |
4845
| misc.c:221:10:221:10 | Store: 1 |
4946
| misc.c:222:10:222:10 | Store: 2 |
50-
| ms_assume.cpp:20:12:20:12 | Constant: (bool)... |
5147
| ms_try_except.cpp:3:9:3:9 | Uninitialized: definition of x |
5248
| ms_try_except.cpp:7:13:7:17 | Store: ... = ... |
5349
| ms_try_except.cpp:9:19:9:19 | Load: j |
@@ -69,6 +65,7 @@ instructionWithoutSuccessor
6965
| ms_try_mix.cpp:51:5:51:11 | ThrowValue: throw ... |
7066
| ms_try_mix.cpp:53:13:54:3 | NoOp: { ... } |
7167
| pointer_to_member.cpp:36:11:36:30 | FieldAddress: {...} |
68+
| pointer_to_member.cpp:36:11:36:30 | FieldAddress: {...} |
7269
| static_init_templates.cpp:80:27:80:36 | Convert: (void *)... |
7370
| static_init_templates.cpp:80:27:80:36 | Convert: (void *)... |
7471
| static_init_templates.cpp:89:27:89:36 | Convert: (void *)... |
@@ -80,7 +77,7 @@ instructionWithoutSuccessor
8077
| stmt_expr.cpp:27:5:27:15 | Store: ... = ... |
8178
| stmt_expr.cpp:29:11:32:11 | CopyValue: (statement expression) |
8279
| stmt_in_type.cpp:5:53:5:53 | Constant: 1 |
83-
| vla.c:5:9:5:14 | VariableAddress: definition of matrix |
80+
| vla.c:5:9:5:14 | Uninitialized: definition of matrix |
8481
| vla.c:5:16:5:19 | Load: argc |
8582
| vla.c:5:22:5:25 | CallReadSideEffect: call to atoi |
8683
| vla.c:11:6:11:16 | UnmodeledDefinition: vla_typedef |
@@ -89,7 +86,6 @@ instructionWithoutSuccessor
8986
| vla.c:13:12:13:14 | Uninitialized: definition of var |
9087
| vla.c:14:36:14:47 | Add: ... + ... |
9188
| vla.c:14:53:14:65 | Mul: ... * ... |
92-
| vla.c:14:69:14:72 | VariableAddress: definition of buf2 |
9389
| vla.c:14:74:14:79 | CallSideEffect: call to getInt |
9490
| vla.c:14:92:14:94 | Store: (char *)... |
9591
ambiguousSuccessors
@@ -614,7 +610,6 @@ lostReachability
614610
backEdgeCountMismatch
615611
useNotDominatedByDefinition
616612
| VacuousDestructorCall.cpp:4:3:4:3 | Load | Operand 'Load' is not dominated by its definition in function '$@'. | VacuousDestructorCall.cpp:2:6:2:6 | IR: CallDestructor | void CallDestructor<int>(int, int*) |
617-
| assume0.cpp:11:2:11:2 | Operand | Operand 'Operand' is not dominated by its definition in function '$@'. | assume0.cpp:5:6:5:6 | IR: h | void h() |
618613
| condition_decls.cpp:16:15:16:15 | Operand | Operand 'Operand' is not dominated by its definition in function '$@'. | condition_decls.cpp:15:6:15:17 | IR: if_decl_bind | void if_decl_bind(int) |
619614
| condition_decls.cpp:16:15:16:16 | Load | Operand 'Load' is not dominated by its definition in function '$@'. | condition_decls.cpp:15:6:15:17 | IR: if_decl_bind | void if_decl_bind(int) |
620615
| condition_decls.cpp:16:15:16:16 | Operand | Operand 'Operand' is not dominated by its definition in function '$@'. | condition_decls.cpp:15:6:15:17 | IR: if_decl_bind | void if_decl_bind(int) |
@@ -683,6 +678,7 @@ useNotDominatedByDefinition
683678
| ms_try_mix.cpp:51:5:51:11 | Load | Operand 'Load' is not dominated by its definition in function '$@'. | ms_try_mix.cpp:47:6:47:28 | IR: ms_empty_finally_at_end | void ms_empty_finally_at_end() |
684679
| pointer_to_member.cpp:36:11:36:30 | Unary | Operand 'Unary' is not dominated by its definition in function '$@'. | pointer_to_member.cpp:32:6:32:14 | IR: pmIsConst | void pmIsConst() |
685680
| pointer_to_member.cpp:36:13:36:19 | Address | Operand 'Address' is not dominated by its definition in function '$@'. | pointer_to_member.cpp:32:6:32:14 | IR: pmIsConst | void pmIsConst() |
681+
| pointer_to_member.cpp:36:22:36:28 | Address | Operand 'Address' is not dominated by its definition in function '$@'. | pointer_to_member.cpp:32:6:32:14 | IR: pmIsConst | void pmIsConst() |
686682
| stmt_expr.cpp:30:20:30:21 | Operand | Operand 'Operand' is not dominated by its definition in function '$@'. | stmt_expr.cpp:21:6:21:6 | IR: g | void stmtexpr::g(int) |
687683
| stmt_expr.cpp:31:16:31:18 | Load | Operand 'Load' is not dominated by its definition in function '$@'. | stmt_expr.cpp:21:6:21:6 | IR: g | void stmtexpr::g(int) |
688684
| try_catch.cpp:21:13:21:24 | Address | Operand 'Address' is not dominated by its definition in function '$@'. | try_catch.cpp:19:6:19:23 | IR: throw_from_nonstmt | void throw_from_nonstmt(int) |

cpp/ql/test/library-tests/syntax-zoo/unaliased_ssa_sanity.expected

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,20 @@ missingPhiOperand
2121
missingOperandType
2222
instructionWithoutSuccessor
2323
| VacuousDestructorCall.cpp:2:29:2:29 | InitializeParameter: y |
24-
| assume0.cpp:7:2:7:2 | CallSideEffect: call to f |
2524
| condition_decls.cpp:16:19:16:20 | CallSideEffect: call to BoxedInt |
2625
| condition_decls.cpp:26:23:26:24 | CallSideEffect: call to BoxedInt |
2726
| condition_decls.cpp:41:22:41:23 | CallSideEffect: call to BoxedInt |
2827
| condition_decls.cpp:48:52:48:53 | CallSideEffect: call to BoxedInt |
2928
| cpp17.cpp:15:11:15:21 | Convert: (void *)... |
30-
| misc.c:171:10:171:13 | VariableAddress: definition of str2 |
29+
| misc.c:171:10:171:13 | Uninitialized: definition of str2 |
3130
| misc.c:219:47:219:48 | InitializeParameter: sp |
3231
| ms_try_except.cpp:3:9:3:9 | Uninitialized: definition of x |
3332
| ms_try_mix.cpp:11:12:11:15 | CallSideEffect: call to C |
3433
| ms_try_mix.cpp:28:12:28:15 | CallSideEffect: call to C |
3534
| ms_try_mix.cpp:48:10:48:13 | CallSideEffect: call to C |
3635
| pointer_to_member.cpp:36:11:36:30 | FieldAddress: {...} |
3736
| stmt_expr.cpp:27:5:27:15 | Store: ... = ... |
38-
| vla.c:5:9:5:14 | VariableAddress: definition of matrix |
37+
| vla.c:5:9:5:14 | Uninitialized: definition of matrix |
3938
| vla.c:11:6:11:16 | UnmodeledDefinition: vla_typedef |
4039
ambiguousSuccessors
4140
| allocators.cpp:14:5:14:8 | UnmodeledDefinition: main | Goto | 4 | allocators.cpp:16:8:16:10 | VariableAddress: definition of foo |

csharp/ql/src/semmle/code/csharp/ir/implementation/raw/gvn/ValueNumbering.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ private predicate variableAddressValueNumber(
136136
VariableAddressInstruction instr, IRFunction irFunc, IRVariable var
137137
) {
138138
instr.getEnclosingIRFunction() = irFunc and
139-
instr.getVariable() = var
139+
instr.getIRVariable() = var
140140
}
141141

142142
private predicate initializeParameterValueNumber(
143143
InitializeParameterInstruction instr, IRFunction irFunc, IRVariable var
144144
) {
145145
instr.getEnclosingIRFunction() = irFunc and
146-
instr.getVariable() = var
146+
instr.getIRVariable() = var
147147
}
148148

149149
private predicate initializeThisValueNumber(InitializeThisInstruction instr, IRFunction irFunc) {

0 commit comments

Comments
 (0)