VerifyError, Inconsistent stack height with try/switch/if combination
<compile files="p1/Base.java,p2/Derived.java"/>
<run class="p2.Derived"/>
</ajc-test>
+
+ <ajc-test dir="bugs" pr="38345" keywords="purejava"
+ title="try switch VerifyError, InconsistentStackHeight">
+ <compile files="TrySwitch.java"/>
+ <run class="TrySwitch"/>
+ </ajc-test>
</suite>
--- /dev/null
+public class TrySwitch {
+ public static void main(String[] args) throws Throwable {
+ m(10);
+ }
+
+ static boolean done = true;
+ static int m(int i) {
+ try {
+ switch(i) {
+ default: return 10;
+ case 10:
+ if (false) {
+ break;
+ } else {
+ throw new RuntimeException();
+ }
+ case 11: break;
+ }
+ } catch (Throwable e) {
+ System.err.println("caught: " + e);
+ }
+ return 33;
+ }
+}
+
+
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
<suite>
+ <ajc-test dir="bugs" pr="38345" keywords="purejava"
+ title="try switch VerifyError, InconsistentStackHeight">
+ <compile files="TrySwitch.java"/>
+ <run class="TrySwitch"/>
+ </ajc-test>
</suite>
\ No newline at end of file