Skip to content

Commit 20529b4

Browse files
committed
C++/C#: Sync identical files
1 parent 14d836b commit 20529b4

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Instruction.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,11 @@ class CallInstruction extends Instruction {
12021202
final Instruction getPositionalArgument(int index) {
12031203
result = getPositionalArgumentOperand(index).getDef()
12041204
}
1205+
1206+
/**
1207+
* Gets the number of arguments of the call, including the `this` pointer, if any.
1208+
*/
1209+
final int getNumberOfArguments() { result = count(this.getAnArgumentOperand()) }
12051210
}
12061211

12071212
/**

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,11 @@ class CallInstruction extends Instruction {
12021202
final Instruction getPositionalArgument(int index) {
12031203
result = getPositionalArgumentOperand(index).getDef()
12041204
}
1205+
1206+
/**
1207+
* Gets the number of arguments of the call, including the `this` pointer, if any.
1208+
*/
1209+
final int getNumberOfArguments() { result = count(this.getAnArgumentOperand()) }
12051210
}
12061211

12071212
/**

csharp/ql/src/semmle/code/csharp/ir/implementation/raw/Instruction.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,11 @@ class CallInstruction extends Instruction {
12021202
final Instruction getPositionalArgument(int index) {
12031203
result = getPositionalArgumentOperand(index).getDef()
12041204
}
1205+
1206+
/**
1207+
* Gets the number of arguments of the call, including the `this` pointer, if any.
1208+
*/
1209+
final int getNumberOfArguments() { result = count(this.getAnArgumentOperand()) }
12051210
}
12061211

12071212
/**

csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/Instruction.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,11 @@ class CallInstruction extends Instruction {
12021202
final Instruction getPositionalArgument(int index) {
12031203
result = getPositionalArgumentOperand(index).getDef()
12041204
}
1205+
1206+
/**
1207+
* Gets the number of arguments of the call, including the `this` pointer, if any.
1208+
*/
1209+
final int getNumberOfArguments() { result = count(this.getAnArgumentOperand()) }
12051210
}
12061211

12071212
/**

0 commit comments

Comments
 (0)