Skip to content

Commit 5b5c1de

Browse files
committed
C++: Fix fan-out.
1 parent b169ccf commit 5b5c1de

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ module GuardsInput implements SharedGuards::InputSig<Cpp::Location, Instruction,
188188
// Note: This only has a value if there is a unique value for the case.
189189
// So the will not be a result when using the GCC case range extension.
190190
// Instead, we model these using the `LogicInput_v1::rangeGuard` predicate.
191-
result.asIntegerValue() = this.getEdge().getValue().toInt()
191+
result = this and exists(this.getEdge().getValue())
192192
}
193193
}
194194

cpp/ql/test/library-tests/controlflow/guards/GuardsControl.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,8 @@
178178
| test.cpp:42:13:42:20 | call to getABool | true | test.cpp:43:9:45:23 | { ... } |
179179
| test.cpp:60:31:60:31 | i | 0 | test.cpp:62:5:64:12 | case ...: |
180180
| test.cpp:60:31:60:31 | i | 1 | test.cpp:65:5:66:10 | case ...: |
181-
| test.cpp:60:31:60:31 | i | 10 | test.cpp:62:5:64:12 | case ...: |
182181
| test.cpp:61:10:61:10 | i | 0 | test.cpp:62:5:64:12 | case ...: |
183182
| test.cpp:61:10:61:10 | i | 1 | test.cpp:65:5:66:10 | case ...: |
184-
| test.cpp:61:10:61:10 | i | 10 | test.cpp:62:5:64:12 | case ...: |
185183
| test.cpp:73:30:73:30 | i | Lower bound 0 | test.cpp:75:5:77:12 | case ...: |
186184
| test.cpp:73:30:73:30 | i | Lower bound 11 | test.cpp:78:5:79:10 | case ...: |
187185
| test.cpp:73:30:73:30 | i | Upper bound 10 | test.cpp:75:5:77:12 | case ...: |

0 commit comments

Comments
 (0)