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

Nashorn: finally-block may execute twice

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 9
    • 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.

            attila Attila Szegedi
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: