summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-30 02:26:30 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-30 02:26:30 +0000
commite561fc44a4cc28984ad5b8f484214df5a7b02ca3 (patch)
tree6e5d5cfddc7bf214e7443d76c2caf793a83a8e21
parent4431d7a72498a824659d9524bd9ed166ba76790f (diff)
merge revision(s) 55297: [Backport #12462]
* vm_insnhelper.c (vm_throw_start): check if the iseq is symbol proc, class definition should not be a symbol proc. [ruby-core:75856] [Bug #12462] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_symbol.rb9
-rw-r--r--version.h6
-rw-r--r--vm_insnhelper.c4
4 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b66f50aef5..9ff92025c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Jul 30 10:58:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_insnhelper.c (vm_throw_start): check if the iseq is symbol
+ proc, class definition should not be a symbol proc.
+ [ruby-core:75856] [Bug #12462]
+
Mon Jul 11 22:35:00 2016 Kenta Murata <mrkn@mrkn.jp>
* bignum.c (rb_big_hash): make it public function to be available in
diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb
index 2133573fc3..540661afc0 100644
--- a/test/ruby/test_symbol.rb
+++ b/test/ruby/test_symbol.rb
@@ -157,6 +157,15 @@ class TestSymbol < Test::Unit::TestCase
assert_equal(1, first, bug11594)
end
+ private def return_from_proc
+ Proc.new { return 1 }.tap(&:call)
+ end
+
+ def test_return_from_symbol_proc
+ bug12462 = '[ruby-core:75856] [Bug #12462]'
+ assert_equal(1, return_from_proc, bug12462)
+ end
+
def test_to_proc_for_hash_each
bug11830 = '[ruby-core:72205] [Bug #11830]'
assert_normal_exit(<<-'end;', bug11830) # do
diff --git a/version.h b/version.h
index deb2c5cbb4..0ea4b46ff5 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.3.2"
-#define RUBY_RELEASE_DATE "2016-07-11"
-#define RUBY_PATCHLEVEL 139
+#define RUBY_RELEASE_DATE "2016-07-30"
+#define RUBY_PATCHLEVEL 140
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 11
+#define RUBY_RELEASE_DAY 30
#include "ruby/version.h"
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 2f34530d04..ba214ebfbe 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -996,7 +996,9 @@ vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ru
target_lep = lep;
}
- if (lep == target_lep && escape_cfp->iseq->body->type == ISEQ_TYPE_CLASS) {
+ if (lep == target_lep &&
+ RUBY_VM_NORMAL_ISEQ_P(escape_cfp->iseq) &&
+ escape_cfp->iseq->body->type == ISEQ_TYPE_CLASS) {
in_class_frame = 1;
target_lep = 0;
}