Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8138840

Compiler crashes when compiling bitwise operations with illegal operand types

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      9
    • Resolved In Build:
      b88
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        When I compile bitwise operations with illegal operand types, I got NPE:

        class Main
        {
                public static void main (String[] args)
                {
                        int x = 0;
                        double d = 0;
                        System.out.println(x & d);
                }
        }

        java.lang.NullPointerException
        at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitApply(Flow.java:1237)
        at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1598)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
        at com.sun.tools.javac.tree.TreeScanner.visitExec(TreeScanner.java:178)
        at com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1416)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
        at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitBlock(Flow.java:999)
        at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:984)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
        at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitMethodDef(Flow.java:966)
        at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:836)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
        at com.sun.tools.javac.comp.Flow$FlowAnalyzer.visitClassDef(Flow.java:929)
        at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:744)
        at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
        at com.sun.tools.javac.comp.Flow$BaseAnalyzer.scan(Flow.java:404)
        at com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1325)
        at com.sun.tools.javac.comp.Flow$FlowAnalyzer.analyzeTree(Flow.java:1315)
        at com.sun.tools.javac.comp.Flow.analyzeTree(Flow.java:212)
        at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1297)
        at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1266)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:871)
        at com.sun.tools.javac.main.Main.compile(Main.java:254)
        at com.sun.tools.javac.main.Main.compile(Main.java:142)
        at com.sun.tools.javac.Main.compile(Main.java:56)
        at com.sun.tools.javac.Main.main(Main.java:42)

        This issue is related to http://hg.openjdk.java.net/jdk9/dev/langtools/rev/098657cc98c9

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mcimadamore Maurizio Cimadamore
                  Reporter:
                  shinyafox Shinya Yoshida
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: