mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8020689: Missing LineNumberTable entries in compiled class files
Reviewed-by: ksrini, mcimadamore
This commit is contained in:
parent
f5da332e66
commit
21ab6d5558
2 changed files with 36 additions and 1 deletions
|
@ -1820,7 +1820,6 @@ public class Gen extends JCTree.Visitor {
|
||||||
msym.externalType(types).getParameterTypes());
|
msym.externalType(types).getParameterTypes());
|
||||||
if (!msym.isDynamic()) {
|
if (!msym.isDynamic()) {
|
||||||
code.statBegin(tree.pos);
|
code.statBegin(tree.pos);
|
||||||
code.markStatBegin();
|
|
||||||
}
|
}
|
||||||
result = m.invoke();
|
result = m.invoke();
|
||||||
}
|
}
|
||||||
|
|
36
langtools/test/tools/javac/jvm/T8020689.java
Normal file
36
langtools/test/tools/javac/jvm/T8020689.java
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* @test /nodynamiccopyright/
|
||||||
|
* @bug 8020689
|
||||||
|
* @summary Making sure the LineNumberTable entry is correctly generated for the leading method invocation in the else section
|
||||||
|
* @compile T8020689.java
|
||||||
|
* @run main T8020689
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class T8020689 {
|
||||||
|
|
||||||
|
public static void main(String... args) {
|
||||||
|
if (args.length > 0) {
|
||||||
|
a();
|
||||||
|
} else {
|
||||||
|
b();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void a() {
|
||||||
|
}
|
||||||
|
|
||||||
|
static void b() {
|
||||||
|
assertLine(15);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void assertLine(int expectedline) {
|
||||||
|
Exception e = new Exception("expected line#: " + expectedline);
|
||||||
|
int myline = e.getStackTrace()[2].getLineNumber();
|
||||||
|
if( myline != expectedline) {
|
||||||
|
throw new RuntimeException("Incorrect line number " +
|
||||||
|
"expected: " + expectedline +
|
||||||
|
", got: " + myline, e);
|
||||||
|
}
|
||||||
|
System.out.format("Got expected line number %d correct %n", myline);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue