mirror of
https://github.com/corda/corda.git
synced 2025-06-17 06:38:21 +00:00
restore state from subroutine after jsr to avoid later confusion determining basic block boundaries
This commit is contained in:
@ -113,6 +113,31 @@ public class Subroutine {
|
||||
}
|
||||
}
|
||||
|
||||
private static long test4(int path) {
|
||||
try {
|
||||
try {
|
||||
switch (path) {
|
||||
case 1:
|
||||
return 42L;
|
||||
|
||||
case 2: {
|
||||
int a = 42;
|
||||
return 52L;
|
||||
}
|
||||
|
||||
case 3:
|
||||
throw new DummyException();
|
||||
}
|
||||
} finally {
|
||||
System.gc();
|
||||
}
|
||||
return 0L;
|
||||
} catch (DummyException e) {
|
||||
e.printStackTrace();
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
test(false, false);
|
||||
test(false, true);
|
||||
@ -157,6 +182,10 @@ public class Subroutine {
|
||||
String.valueOf(test3(1, 3, 3));
|
||||
String.valueOf(test3(2, 3, 3));
|
||||
String.valueOf(test3(3, 3, 3));
|
||||
|
||||
String.valueOf(test4(1));
|
||||
String.valueOf(test4(2));
|
||||
String.valueOf(test4(3));
|
||||
}
|
||||
|
||||
private static class DummyException extends RuntimeException { }
|
||||
|
Reference in New Issue
Block a user