Skip to content

Commit 6777c8c

Browse files
committed
C++: Use the cached getInstructionCount
The object-oriented `IRBlock` interface was recomputing instruction counts instead of using the cached count that had already been computed.
1 parent f5e419e commit 6777c8c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRBlock.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class IRBlockBase extends TIRBlock {
6060
}
6161

6262
final int getInstructionCount() {
63-
result = strictcount(getInstruction(_))
63+
result = getInstructionCount(this)
6464
}
6565

6666
final FunctionIR getEnclosingFunctionIR() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class IRBlockBase extends TIRBlock {
6060
}
6161

6262
final int getInstructionCount() {
63-
result = strictcount(getInstruction(_))
63+
result = getInstructionCount(this)
6464
}
6565

6666
final FunctionIR getEnclosingFunctionIR() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class IRBlockBase extends TIRBlock {
6060
}
6161

6262
final int getInstructionCount() {
63-
result = strictcount(getInstruction(_))
63+
result = getInstructionCount(this)
6464
}
6565

6666
final FunctionIR getEnclosingFunctionIR() {

0 commit comments

Comments
 (0)