8058708: java.lang.AssertionError compiling source code

Reviewed-by: jjg
This commit is contained in:
Vicente Romero 2014-09-25 17:09:23 -07:00
parent 187e5e2014
commit 97309123c1
3 changed files with 20 additions and 7 deletions
langtools
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm
test/tools/javac/flow

@ -2032,12 +2032,11 @@ public class Code {
void adjustAliveRanges(int oldCP, int delta) {
for (LocalVar localVar: lvar) {
if (localVar == null) {
return;
}
for (LocalVar.Range range: localVar.aliveRanges) {
if (range.closed() && range.start_pc + range.length >= oldCP) {
range.length += delta;
if (localVar != null) {
for (LocalVar.Range range: localVar.aliveRanges) {
if (range.closed() && range.start_pc + range.length >= oldCP) {
range.length += delta;
}
}
}
}

@ -23,7 +23,7 @@
/*
* @test
* @bug 7047734 8027660 8037937 8047719
* @bug 7047734 8027660 8037937 8047719 8058708
* @summary The LVT is not generated correctly during some try/catch scenarios
* javac crash while creating LVT entry for a local variable defined in
* an inner block

@ -58,4 +58,18 @@ public class TestCaseIf {
}
o = "";
}
@AliveRange(varName="finalLocal", bytecodeStart=11, bytecodeLength=6)
@AliveRange(varName="used", bytecodeStart=13, bytecodeLength=4)
void m5(Object o) {
if (o != null) {
Object notUsed;
Object used;
if (o != null) {
final Object finalLocal = null;
used = null;
if (o == null) {}
}
}
}
}