Skip to content

Commit 63752dd

Browse files
committed
C++/C#: Sync identical files
1 parent 3af679e commit 63752dd

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,17 @@ private predicate operandReturned(Operand operand, IntValue bitOffset) {
196196
bitOffset = Ints::unknown()
197197
}
198198

199-
private predicate isArgumentForParameter(CallInstruction ci, Operand operand, Instruction init) {
199+
private predicate isArgumentForParameter(
200+
CallInstruction ci, Operand operand, InitializeParameterInstruction init
201+
) {
200202
exists(Language::Function f |
201203
ci = operand.getUse() and
202204
f = ci.getStaticCallTarget() and
203205
(
204-
init.(InitializeParameterInstruction).getParameter() =
205-
f.getParameter(operand.(PositionalArgumentOperand).getIndex())
206+
init.getParameter() = f.getParameter(operand.(PositionalArgumentOperand).getIndex())
206207
or
207-
init.(InitializeParameterInstruction).getIRVariable() instanceof IRThisVariable and
208-
init.getEnclosingFunction() = f and
208+
init.getIRVariable() instanceof IRThisVariable and
209+
unique( | | init.getEnclosingFunction()) = f and
209210
operand instanceof ThisArgumentOperand
210211
) and
211212
not Language::isFunctionVirtual(f) and

csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/AliasAnalysis.qll

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,17 @@ private predicate operandReturned(Operand operand, IntValue bitOffset) {
196196
bitOffset = Ints::unknown()
197197
}
198198

199-
private predicate isArgumentForParameter(CallInstruction ci, Operand operand, Instruction init) {
199+
private predicate isArgumentForParameter(
200+
CallInstruction ci, Operand operand, InitializeParameterInstruction init
201+
) {
200202
exists(Language::Function f |
201203
ci = operand.getUse() and
202204
f = ci.getStaticCallTarget() and
203205
(
204-
init.(InitializeParameterInstruction).getParameter() =
205-
f.getParameter(operand.(PositionalArgumentOperand).getIndex())
206+
init.getParameter() = f.getParameter(operand.(PositionalArgumentOperand).getIndex())
206207
or
207-
init.(InitializeParameterInstruction).getIRVariable() instanceof IRThisVariable and
208-
init.getEnclosingFunction() = f and
208+
init.getIRVariable() instanceof IRThisVariable and
209+
unique( | | init.getEnclosingFunction()) = f and
209210
operand instanceof ThisArgumentOperand
210211
) and
211212
not Language::isFunctionVirtual(f) and

0 commit comments

Comments
 (0)