6807255: LineNumberTable wrong if enhanced-for-loops are used
authormcimadamore
Thu, 05 Mar 2009 17:25:13 +0000
changeset 2220 dfae517d8078
parent 2219 03b1b17c4b2e
child 2221 cd6557bcaa0a
6807255: LineNumberTable wrong if enhanced-for-loops are used Summary: end position of iterable for-each loop was not set properly Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu Mar 05 17:24:40 2009 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu Mar 05 17:25:13 2009 +0000
@@ -3012,6 +3012,7 @@
                                                   vardefinit).setType(tree.var.type);
             indexDef.sym = tree.var.sym;
             JCBlock body = make.Block(0, List.of(indexDef, tree.body));
+            body.endpos = TreeInfo.endPos(tree.body);
             result = translate(make.
                 ForLoop(List.of(init),
                         cond,