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

For loop with "true" as condition results in AssertionError in codegen

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P3
    • Resolution: Fixed
    • None
    • 8
    • core-libs
    • None
    • b84
    • generic
    • generic
    • Verified

    Description

      Script:

      for(;true;) {
        break;
      }


      Exception:

       jjs x.js
      Exception in thread "main" java.lang.AssertionError: forNode for (; ; ) needs goto and is missing it in [object] function runScript()
      at jdk.nashorn.internal.codegen.FinalizeTypes.leave(FinalizeTypes.java:405)
      at jdk.nashorn.internal.ir.ForNode.accept(ForNode.java:94)
      at jdk.nashorn.internal.ir.Block.accept(Block.java:264)
      at jdk.nashorn.internal.ir.ExecuteNode.accept(ExecuteNode.java:89)
      at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:336)
      at jdk.nashorn.internal.codegen.CompilationPhase$6.transform(CompilationPhase.java:218)
      at jdk.nashorn.internal.codegen.CompilationPhase.apply(CompilationPhase.java:372)
      at jdk.nashorn.internal.codegen.Compiler.compile(Compiler.java:263)
      at jdk.nashorn.internal.runtime.Context.compile(Context.java:758)
      at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:720)
      at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:358)
      at jdk.nashorn.tools.Shell.runScripts(Shell.java:293)
      at jdk.nashorn.tools.Shell.run(Shell.java:171)
      at jdk.nashorn.tools.Shell.main(Shell.java:139)
      at jdk.nashorn.tools.Shell.main(Shell.java:118)

      Attachments

        Activity

          People

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: