mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-dfa] Copy state for catch (regression after AIOOBE handling)
Fixes IDEA-349343 Exceptions during DFA Dataflow interpretation error (wasForciblyMerged = false), throwable=java.lang.IllegalStateException: Stack for instruction 72 increased by 13; it's likely that IR was built incorrectly GitOrigin-RevId: 2ebeeb9b58d6daa94ff885d20c606cae6e5391bb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e07cedf5b3
commit
6a98eecf0f
+1
-1
@@ -50,7 +50,7 @@ public class ArrayAccessInstruction extends ExpressionPushingInstruction {
|
||||
DfaValue array = stateBefore.pop();
|
||||
List<DfaInstructionState> finalStates = new ArrayList<>();
|
||||
if (myOutOfBoundsTransfer != null) {
|
||||
finalStates.addAll(IndexOutOfBoundsProblem.dispatchTransfer(interpreter, stateBefore, myOutOfBoundsTransfer));
|
||||
finalStates.addAll(IndexOutOfBoundsProblem.dispatchTransfer(interpreter, stateBefore.createCopy(), myOutOfBoundsTransfer));
|
||||
}
|
||||
DfaInstructionState[] states = myProblem.processOutOfBounds(interpreter, stateBefore, index, array, myOutOfBoundsTransfer);
|
||||
if (states != null) return states;
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class ArrayStoreInstruction extends ExpressionPushingInstruction {
|
||||
DfaValue array = stateBefore.pop();
|
||||
List<DfaInstructionState> finalStates = new ArrayList<>();
|
||||
if (myOutOfBoundsTransfer != null) {
|
||||
finalStates.addAll(IndexOutOfBoundsProblem.dispatchTransfer(interpreter, stateBefore, myOutOfBoundsTransfer));
|
||||
finalStates.addAll(IndexOutOfBoundsProblem.dispatchTransfer(interpreter, stateBefore.createCopy(), myOutOfBoundsTransfer));
|
||||
}
|
||||
DfaInstructionState[] states =
|
||||
myIndexProblem.processOutOfBounds(interpreter, stateBefore, index, array, myOutOfBoundsTransfer);
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
class Scratch {
|
||||
public static void main(String[] files) {
|
||||
try {
|
||||
System.out.println(files[0]);
|
||||
files[1] = "hello";
|
||||
}
|
||||
catch (RuntimeException e) {
|
||||
System.out.println(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -579,6 +579,7 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
|
||||
public void testGetterOfNullableFieldIsNotNull() { doTest(); }
|
||||
|
||||
public void testArrayStoreProblems() { doTest(); }
|
||||
public void testArrayAccessInTry() { doTest(); }
|
||||
|
||||
public void testNestedScopeComplexity() { doTest(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user