mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
java: rewrite conflict detection
- favour unary predicates over binary ones (the natural "conflicting access" is binary) - switch to a dual solution to trade recursion through forall for simple existentials. Co-authored-by: Anders Schack-Mulligen <aschackmull@github.com>
This commit is contained in:
@@ -12,25 +12,25 @@ public class C {
|
||||
|
||||
public void m() {
|
||||
this.y = 0; // $ Alert
|
||||
this.y += 1;
|
||||
this.y = this.y - 1;
|
||||
this.y += 1; // $ Alert
|
||||
this.y = this.y - 1; // $ Alert
|
||||
}
|
||||
|
||||
public void n4() {
|
||||
this.y = 0;
|
||||
this.y += 1;
|
||||
this.y = this.y - 1;
|
||||
this.y = 0; // $ Alert
|
||||
this.y += 1; // $ Alert
|
||||
this.y = this.y - 1; // $ Alert
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
this.y = y; // $ Alert
|
||||
}
|
||||
|
||||
public void test() {
|
||||
if (y == 0) {
|
||||
if (y == 0) { // $ Alert
|
||||
lock.lock();
|
||||
}
|
||||
y = 0;
|
||||
y = 0; // $ Alert
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user