Nashorn: finally-block may execute twice

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • 9
    • Affects Version/s: 9
    • Component/s: core-libs
    • generic
    • linux_ubuntu

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      Incorrect byte code is generated if the try-block ends with a terminal node (except for throw). Combined with a throw statement in the finally block, the finally block will be executed twice.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      jjs> function f() { try { print("try"); return } finally { print("finally"); throw 0 } } f();

      Expected: output is "try finally"
      Actual: output is "try finally finally"


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Assignee:
            Attila Szegedi
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: