Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8024971 Fuzzing results on nashorn by Andre
  3. JDK-8047357

Function("switch((null >> x3)) { default: {var x; break ; }\nthrow x; }")() results in AssertionError in LocalVariableTypesCalculator

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None

      Backports

        Description

        jjs -J-Djava.ext.dirs=$jdk9-dev/nashorn/dist/ -J-ea -J-esa

        jjs> Function("switch((null >> x3)) { default: {var x; break ; }\nthrow x; }")()

        Exception in thread "main" java.lang.AssertionError
        at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.getLocalVariableType(LocalVariableTypesCalculator.java:975)
        at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.symbolIsUsed(LocalVariableTypesCalculator.java:1414)
        at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterIdentNode(LocalVariableTypesCalculator.java:604)
        at jdk.nashorn.internal.ir.IdentNode.accept(IdentNode.java:134)
        at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterThrowNode(LocalVariableTypesCalculator.java:844)
        at jdk.nashorn.internal.ir.ThrowNode.accept(ThrowNode.java:78)
        at jdk.nashorn.internal.ir.Node.accept(Node.java:268)
        at jdk.nashorn.internal.ir.Block.accept(Block.java:152)
        at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
        at jdk.nashorn.internal.ir.Block.accept(Block.java:386)
        at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterSwitchNode(LocalVariableTypesCalculator.java:753)
        at jdk.nashorn.internal.ir.SwitchNode.accept(SwitchNode.java:104)
        at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
        at jdk.nashorn.internal.ir.LexicalContextStatement.accept(LexicalContextStatement.java:53)
        at jdk.nashorn.internal.ir.SwitchNode.accept(SwitchNode.java:38)
        at jdk.nashorn.internal.ir.Node.accept(Node.java:268)
        at jdk.nashorn.internal.ir.Block.accept(Block.java:152)
        at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
        at jdk.nashorn.internal.ir.Block.accept(Block.java:386)
        at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:351)
        at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
        at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
        at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:52)
        at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator$1.leaveFunctionNode(LocalVariableTypesCalculator.java:1179)
        at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:351)
        at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
        at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
        at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:52)
        at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:319)
        at jdk.nashorn.internal.ir.ExpressionStatement.accept(ExpressionStatement.java:67)
        at jdk.nashorn.internal.ir.Node.accept(Node.java:268)
        at jdk.nashorn.internal.ir.Block.accept(Block.java:152)
        at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
        at jdk.nashorn.internal.ir.Block.accept(Block.java:386)
        at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.leaveFunctionNode(LocalVariableTypesCalculator.java:1235)
        at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:351)
        at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
        at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
        at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:52)
        at jdk.nashorn.internal.codegen.CompilationPhase$9.transform(CompilationPhase.java:277)
        at jdk.nashorn.internal.codegen.CompilationPhase.apply(CompilationPhase.java:685)
        at jdk.nashorn.internal.codegen.Compiler.compile(Compiler.java:506)
        at jdk.nashorn.internal.runtime.Context.compile(Context.java:1106)
        at jdk.nashorn.internal.runtime.Context.eval(Context.java:580)
        at jdk.nashorn.internal.objects.Global.directEval(Global.java:886)
        at jdk.nashorn.internal.objects.NativeFunction.function(NativeFunction.java:286)
        at jdk.nashorn.internal.scripts.Script$1$\^shell\_.:program(<shell>:1)
        at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:567)
        at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:221)
        at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:374)
        at jdk.nashorn.internal.runtime.Context.eval(Context.java:620)
        at jdk.nashorn.tools.Shell.readEvalPrint(Shell.java:448)
        at jdk.nashorn.tools.Shell.run(Shell.java:158)
        at jdk.nashorn.tools.Shell.main(Shell.java:133)
        at jdk.nashorn.tools.Shell.main(Shell.java:112)

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                attila Attila Szegedi
                Reporter:
                sundar Sundararajan Athijegannathan
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: