8059710: javac, the same approach used in fix for JDK-8058708 should be applied to Code.closeAliveRanges
authorvromero
Thu, 23 Oct 2014 10:40:02 -0700
changeset 27227 b63718dce4c1
parent 27226 53535e4e1b08
child 27228 da96e0643b5c
8059710: javac, the same approach used in fix for JDK-8058708 should be applied to Code.closeAliveRanges Reviewed-by: jjg
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java	Tue Oct 21 17:50:13 2014 -0700
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java	Thu Oct 23 10:40:02 2014 -0700
@@ -2017,13 +2017,12 @@
         List<VarSymbol> locals = lvtRanges.getVars(meth, tree);
         for (LocalVar localVar: lvar) {
             for (VarSymbol aliveLocal : locals) {
-                if (localVar == null) {
-                    return;
-                }
-                if (localVar.sym == aliveLocal && localVar.lastRange() != null) {
-                    char length = (char)(closingCP - localVar.lastRange().start_pc);
-                    if (length < Character.MAX_VALUE) {
-                        localVar.closeRange(length);
+                if (localVar != null) {
+                    if (localVar.sym == aliveLocal && localVar.lastRange() != null) {
+                        char length = (char)(closingCP - localVar.lastRange().start_pc);
+                        if (length < Character.MAX_VALUE) {
+                            localVar.closeRange(length);
+                        }
                     }
                 }
             }