@@ -1589,7 +1589,8 @@ interface ClassFileConsumer {
1589
1589
}
1590
1590
1591
1591
/**
1592
- * Called to check whether the given {@link Rvalue} compiles or not.
1592
+ * Called to check whether the given {@link BlockStatement} compiles or not.
1593
+ * Updates the stack map of the current inserter.
1593
1594
*
1594
1595
* @return Whether the block statement can complete normally
1595
1596
*/
@@ -1604,7 +1605,6 @@ interface ClassFileConsumer {
1604
1605
1605
1606
this.getCodeContext().removeCode(from, to);
1606
1607
1607
- this.codeContext.currentInserter().setStackMap(from.getStackMap());
1608
1608
return ccn;
1609
1609
}
1610
1610
@@ -2570,10 +2570,12 @@ private enum SwitchKind { INT, ENUM, STRING }
2570
2570
final CodeContext.Inserter ins = this.getCodeContext().newInserter();
2571
2571
StackMap smBeforeSeeingStatement = this.codeContext.currentInserter().getStackMap();
2572
2572
boolean ssccn = this.compile(seeingStatement);
2573
+ Offset afterSeeingStatement = this.codeContext.newOffset();
2573
2574
2574
2575
// Fake-compile the blind statement.
2575
2576
this.codeContext.currentInserter().setStackMap(smBeforeSeeingStatement);
2576
2577
boolean bsccn = this.fakeCompile(blindStatement);
2578
+ afterSeeingStatement.setStackMap(); // Merge stack maps after seeing and after blind statements.
2577
2579
2578
2580
if (ssccn) return true;
2579
2581
if (!bsccn) return false;
@@ -2611,7 +2613,6 @@ private enum SwitchKind { INT, ENUM, STRING }
2611
2613
boolean tsccn = this.compile(ts);
2612
2614
if (tsccn) {
2613
2615
this.gotO(is, end);
2614
- } else {
2615
2616
}
2616
2617
2617
2618
// Compile "else" statment.
0 commit comments