mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DFA: do not flush array length on element write
This commit is contained in:
+3
-1
@@ -139,7 +139,9 @@ public abstract class InstructionVisitor {
|
||||
if (variable != null) {
|
||||
if (instruction.isDependentsOnly()) {
|
||||
for (DfaVariableValue qualified : runner.getFactory().getVarFactory().getAllQualifiedBy(variable)) {
|
||||
memState.flushVariable(qualified);
|
||||
if (qualified.isFlushableByCalls()) {
|
||||
memState.flushVariable(qualified);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class ArrayLength {
|
||||
void testEquality(int[] x) {
|
||||
int len = x.length;
|
||||
for(int i=0; i<100; i++) {
|
||||
if (i == len) {
|
||||
x[<warning descr="Array index is out of bounds">i</warning>] = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int[] testFor(int length) {
|
||||
int[] x = new int[length];
|
||||
for(int i=0; i<=length; i++) {
|
||||
x[i] = 1;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
public static void testArray2(Object[] x, Object[] y, int a) {
|
||||
if(<warning descr="Condition 'x[a] == null && a == x.length' is always 'false'">x[a] == null && <warning descr="Condition 'a == x.length' is always 'false' when reached">a == x.length</warning></warning>) {
|
||||
System.out.println("Impossible");
|
||||
|
||||
Reference in New Issue
Block a user