mirror of
https://github.com/corda/corda.git
synced 2025-03-02 04:34:13 +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
|
object
|
||||||
translateLineNumberTable(MyThread* t, Context* context, intptr_t start)
|
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));
|
object oldTable = codeLineNumberTable(t, methodCode(t, context->method));
|
||||||
if (oldTable) {
|
if (oldTable) {
|
||||||
PROTECT(t, oldTable);
|
PROTECT(t, oldTable);
|
||||||
|
@ -253,6 +253,16 @@ public class Subroutine {
|
|||||||
return true;
|
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 {
|
public static void main(String[] args) throws Exception {
|
||||||
test(false, false);
|
test(false, false);
|
||||||
test(false, true);
|
test(false, true);
|
||||||
@ -311,6 +321,15 @@ public class Subroutine {
|
|||||||
(null, new Object[0]);
|
(null, new Object[0]);
|
||||||
|
|
||||||
stackMap(new Object());
|
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 { }
|
private static class DummyException extends RuntimeException { }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user