Additional diagnostic for internal state during jvm codegen
This commit is contained in:
@@ -4570,7 +4570,12 @@ The "returned" value of try expression with no finally is either the last expres
|
|||||||
private void generateExceptionTable(@NotNull Label catchStart, @NotNull List<Label> catchedRegions, @Nullable String exception) {
|
private void generateExceptionTable(@NotNull Label catchStart, @NotNull List<Label> catchedRegions, @Nullable String exception) {
|
||||||
for (int i = 0; i < catchedRegions.size(); i += 2) {
|
for (int i = 0; i < catchedRegions.size(); i += 2) {
|
||||||
Label startRegion = catchedRegions.get(i);
|
Label startRegion = catchedRegions.get(i);
|
||||||
Label endRegion = catchedRegions.get(i+1);
|
Label endRegion = catchedRegions.get(i + 1);
|
||||||
|
|
||||||
|
if (startRegion.info == null || endRegion.info == null || catchStart.info == null) {
|
||||||
|
throw new IllegalStateException("All labels should have nodes added to instruction list");
|
||||||
|
}
|
||||||
|
|
||||||
v.visitTryCatchBlock(startRegion, endRegion, catchStart, exception);
|
v.visitTryCatchBlock(startRegion, endRegion, catchStart, exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -314,6 +314,10 @@ public class MaxStackFrameSizeAndLocalsCalculator extends MaxLocalsCalculator {
|
|||||||
LabelWrapper e = handler.end;
|
LabelWrapper e = handler.end;
|
||||||
|
|
||||||
while (l != e) {
|
while (l != e) {
|
||||||
|
if (l == null) {
|
||||||
|
throw new IllegalStateException("Bad exception handler end");
|
||||||
|
}
|
||||||
|
|
||||||
l.addSuccessor(handler.handlerLabel, 0, true);
|
l.addSuccessor(handler.handlerLabel, 0, true);
|
||||||
l = l.nextLabel;
|
l = l.nextLabel;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user