mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Shared: Bugfix for unique value implication.
This commit is contained in:
@@ -127,4 +127,20 @@ public class Guards {
|
||||
chk(); // $ guarded='o != null:false' guarded=g(1):false
|
||||
}
|
||||
}
|
||||
|
||||
void t7(int[] a) {
|
||||
boolean found = false;
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
boolean answer = a[i] == 42;
|
||||
if (answer) {
|
||||
found = true;
|
||||
}
|
||||
if (found) {
|
||||
chk(); // $ guarded=found:true guarded='i < a.length:true'
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
chk(); // $ guarded=found:true guarded='i < a.length:false'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,3 +54,7 @@
|
||||
| Guards.java:125:7:125:11 | chk(...) | 'o != null:true' |
|
||||
| Guards.java:127:7:127:11 | chk(...) | 'o != null:false' |
|
||||
| Guards.java:127:7:127:11 | chk(...) | g(1):false |
|
||||
| Guards.java:139:9:139:13 | chk(...) | 'i < a.length:true' |
|
||||
| Guards.java:139:9:139:13 | chk(...) | found:true |
|
||||
| Guards.java:143:7:143:11 | chk(...) | 'i < a.length:false' |
|
||||
| Guards.java:143:7:143:11 | chk(...) | found:true |
|
||||
|
||||
Reference in New Issue
Block a user