diff options
author | Koichi Sasada <ko1@atdot.net> | 2021-04-22 10:44:52 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2021-04-22 11:33:39 +0900 |
commit | 609de71f043e8ba34f22b9993e444e2e5bb05709 (patch) | |
tree | 531d2d941add4c819ad975fb4d26b6e2b2d771bf /iseq.h | |
parent | 5512353d97250e85c13bf10b9b32e750478cf474 (diff) |
fix raise in exception with jump
add_ensure_iseq() adds ensure block to the end of
jump such as next/redo/return. However, if the rescue
cause are in the body, this rescue catches the exception
in ensure clause.
iter do
next
rescue
R
ensure
raise
end
In this case, R should not be executed, but executed without this patch.
Fixes [Bug #13930]
Fixes [Bug #16618]
A part of tests are written by @jeremyevans https://github.com/ruby/ruby/pull/4291
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4399
Diffstat (limited to 'iseq.h')
-rw-r--r-- | iseq.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -101,6 +101,7 @@ struct iseq_compile_data { struct iseq_compile_data_storage *storage_head; struct iseq_compile_data_storage *storage_current; } insn; + bool in_rescue; int loopval_popped; /* used by NODE_BREAK */ int last_line; int label_no; |