summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-20 16:21:30 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-20 16:21:30 +0000
commit0c0be80f5e9f43b48527c57da633f280171e1cf5 (patch)
tree59acd92ba6417a12fc5d1fb34e20cfc7e243902f
parent3e199f4c2b49a17104a0878f8e8505ab2411a608 (diff)
merge revision(s) 49390: [Backport #10775]
* vm_insnhelper.c (vm_throw_start): search the target to break from a block with nested rescue, from the nested blocks. [ruby-core:67765] [Bug #10775] [Fix GH-820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--bootstraptest/test_block.rb14
-rw-r--r--version.h2
-rw-r--r--vm_insnhelper.c4
4 files changed, 22 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d0b4cdd51e..394a38de2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu May 21 01:07:41 2015 Misumi Rize <r@ayase-e.li>
+
+ * vm_insnhelper.c (vm_throw_start): search the target to break
+ from a block with nested rescue, from the nested blocks.
+ [ruby-core:67765] [Bug #10775] [Fix GH-820]
+
Thu May 21 00:55:45 2015 Koichi Sasada <ko1@atdot.net>
* vm_args.c: protect value stack from calling other methods
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
index 6a2ccfc6da..cdc5960a59 100644
--- a/bootstraptest/test_block.rb
+++ b/bootstraptest/test_block.rb
@@ -597,3 +597,17 @@ assert_equal 'true', %q{
C1.new.foo{}
}
+assert_equal 'ok', %q{
+ 1.times do
+ begin
+ raise
+ rescue
+ begin
+ raise
+ rescue
+ break
+ end
+ end
+ end
+ 'ok'
+}
diff --git a/version.h b/version.h
index 7697eb513c..9789056629 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.2.3"
#define RUBY_RELEASE_DATE "2015-05-21"
-#define RUBY_PATCHLEVEL 112
+#define RUBY_PATCHLEVEL 113
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 5
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 2404ad00eb..8b2f8e78c4 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -630,13 +630,11 @@ vm_throw_start(rb_thread_t * const th, rb_control_frame_t * const reg_cfp, int s
rb_iseq_t *base_iseq = GET_ISEQ();
escape_cfp = reg_cfp;
- search_parent:
- if (base_iseq->type != ISEQ_TYPE_BLOCK) {
+ while (base_iseq->type != ISEQ_TYPE_BLOCK) {
if (escape_cfp->iseq->type == ISEQ_TYPE_CLASS) {
escape_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(escape_cfp);
ep = escape_cfp->ep;
base_iseq = escape_cfp->iseq;
- goto search_parent;
}
else {
ep = VM_EP_PREV_EP(ep);