diff --git a/src/compile.cpp b/src/compile.cpp index 37b0a5f4ec..5a316ff682 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -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); diff --git a/test/Subroutine.java b/test/Subroutine.java index d566f78095..5fb5bfa223 100644 --- a/test/Subroutine.java +++ b/test/Subroutine.java @@ -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 { }