mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
test line number table generation in subroutines
This commit is contained in:
parent
9273d5ca39
commit
37d104871c
@ -6431,7 +6431,6 @@ object translateExceptionHandlerTable(MyThread* t,
|
||||
object
|
||||
translateLineNumberTable(MyThread* t, Context* context, intptr_t start)
|
||||
{
|
||||
// TODO: add line number table entries for subroutines (duplicated code)
|
||||
object oldTable = codeLineNumberTable(t, methodCode(t, context->method));
|
||||
if (oldTable) {
|
||||
PROTECT(t, oldTable);
|
||||
|
@ -253,6 +253,16 @@ public class Subroutine {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static int test6(boolean predicate) {
|
||||
try {
|
||||
if (predicate) {
|
||||
return -2;
|
||||
}
|
||||
} finally {
|
||||
return new Throwable().getStackTrace()[0].getLineNumber();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
test(false, false);
|
||||
test(false, true);
|
||||
@ -311,6 +321,15 @@ public class Subroutine {
|
||||
(null, new Object[0]);
|
||||
|
||||
stackMap(new Object());
|
||||
|
||||
{
|
||||
int f = test6(false);
|
||||
int t = test6(true);
|
||||
System.out.println("line: " + f);
|
||||
expect(f > 0);
|
||||
expect(f == t);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class DummyException extends RuntimeException { }
|
||||
|
Loading…
Reference in New Issue
Block a user