-
Bug
-
Resolution: Duplicate
-
P4
-
9
-
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.
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.
- duplicates
-
JDK-8067139 Finally blocks inlined incorrectly
- Closed
-
JDK-8074465 Nashorn - finally clause executed twice
- Closed
- relates to
-
JDK-8066231 Fuzzing bug: Invalid symbol slot
- Closed