Merge

Fri, 02 Nov 2012 19:17:03 -0700

author
jjg
date
Fri, 02 Nov 2012 19:17:03 -0700
changeset 1390
a33770a91b00
parent 1386
bf76f4190ef8
parent 1389
2443d24d096a
child 1391
ef3ad754f5c7

Merge

     1.1 --- a/src/share/classes/com/sun/tools/javac/jvm/CRTable.java	Fri Nov 02 14:35:57 2012 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/CRTable.java	Fri Nov 02 19:17:03 2012 -0700
     1.3 @@ -503,6 +503,14 @@
     1.4              result = sr;
     1.5          }
     1.6  
     1.7 +        @Override
     1.8 +        public void visitLetExpr(LetExpr tree) {
     1.9 +            SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
    1.10 +            sr.mergeWith(csp(tree.defs));
    1.11 +            sr.mergeWith(csp(tree.expr));
    1.12 +            result = sr;
    1.13 +        }
    1.14 +
    1.15          public void visitTypeParameter(JCTypeParameter tree) {
    1.16              SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
    1.17              sr.mergeWith(csp(tree.bounds));
    1.18 @@ -525,7 +533,7 @@
    1.19           */
    1.20          public int startPos(JCTree tree) {
    1.21              if (tree == null) return Position.NOPOS;
    1.22 -            return tree.pos;
    1.23 +            return TreeInfo.getStartPos(tree);
    1.24          }
    1.25  
    1.26          /** The end position of given tree, if it has
    1.27 @@ -533,9 +541,7 @@
    1.28           */
    1.29          public int endPos(JCTree tree) {
    1.30              if (tree == null) return Position.NOPOS;
    1.31 -            if (tree.hasTag(JCTree.Tag.BLOCK))
    1.32 -                return ((JCBlock) tree).endpos;
    1.33 -            return endPosTable.getEndPos(tree);
    1.34 +            return TreeInfo.getEndPos(tree, endPosTable);
    1.35          }
    1.36      }
    1.37  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/test/tools/javac/options/T6949443.java	Fri Nov 02 19:17:03 2012 -0700
     2.3 @@ -0,0 +1,36 @@
     2.4 +/*
     2.5 + * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
     2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.7 + *
     2.8 + * This code is free software; you can redistribute it and/or modify it
     2.9 + * under the terms of the GNU General Public License version 2 only, as
    2.10 + * published by the Free Software Foundation.
    2.11 + *
    2.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    2.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    2.15 + * version 2 for more details (a copy is included in the LICENSE file that
    2.16 + * accompanied this code).
    2.17 + *
    2.18 + * You should have received a copy of the GNU General Public License version
    2.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    2.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    2.21 + *
    2.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    2.23 + * or visit www.oracle.com if you need additional information or have any
    2.24 + * questions.
    2.25 + */
    2.26 +
    2.27 +/*
    2.28 + * @test
    2.29 + * @bug 6949443
    2.30 + * @summary VisitTree assertion triggered using -Xjcov on small sample program
    2.31 + * @compile -Xjcov T6949443.java
    2.32 + */
    2.33 +
    2.34 +public class T6949443 {
    2.35 +    public static void main(String[] args) {
    2.36 +        Integer i = 0;
    2.37 +        i++;
    2.38 +    }
    2.39 +}

mercurial