ruby-changes:25494
From: usa <ko1@a...>
Date: Thu, 8 Nov 2012 14:12:09 +0900 (JST)
Subject: [ruby-changes:25494] usa:r37551 (ruby_1_9_3): merge revision(s) 37270: [Backport #7185]
usa 2012-11-08 14:12:00 +0900 (Thu, 08 Nov 2012) New Revision: 37551 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37551 Log: merge revision(s) 37270: [Backport #7185] * vm.c (rb_vm_jump_tag_but_local_jump): pass through thrown objects. [ruby-dev:46234] [Bug #7185] * vm_eval.c (rb_eval_cmd): if state is non-zero, val should be nil and rb_vm_jump_tag_but_local_jump() just jump tag. Modified directories: branches/ruby_1_9_3/ Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/test/ruby/test_exception.rb branches/ruby_1_9_3/version.h branches/ruby_1_9_3/vm.c branches/ruby_1_9_3/vm_eval.c Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 37550) +++ ruby_1_9_3/ChangeLog (revision 37551) @@ -1,3 +1,11 @@ +Thu Nov 8 14:11:49 2012 Nobuyoshi Nakada <nobu@r...> + + * vm.c (rb_vm_jump_tag_but_local_jump): pass through thrown objects. + [ruby-dev:46234] [Bug #7185] + + * vm_eval.c (rb_eval_cmd): if state is non-zero, val should be nil and + rb_vm_jump_tag_but_local_jump() just jump tag. + Thu Nov 8 14:09:18 2012 Kenta Murata <mrkn@m...> * ext/bigdecimal/bigdecimal.c (BigDecimal_add), Index: ruby_1_9_3/vm_eval.c =================================================================== --- ruby_1_9_3/vm_eval.c (revision 37550) +++ ruby_1_9_3/vm_eval.c (revision 37551) @@ -1212,7 +1212,7 @@ POP_TAG(); rb_set_safe_level_force(safe); - if (state) rb_vm_jump_tag_but_local_jump(state, val); + if (state) JUMP_TAG(state); return val; } Index: ruby_1_9_3/vm.c =================================================================== --- ruby_1_9_3/vm.c (revision 37550) +++ ruby_1_9_3/vm.c (revision 37551) @@ -999,7 +999,7 @@ { if (val != Qnil) { VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, val); - rb_exc_raise(exc); + if (!NIL_P(exc)) rb_exc_raise(exc); } JUMP_TAG(state); } Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 37550) +++ ruby_1_9_3/version.h (revision 37551) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 307 +#define RUBY_PATCHLEVEL 308 #define RUBY_RELEASE_DATE "2012-11-08" #define RUBY_RELEASE_YEAR 2012 Index: ruby_1_9_3/test/ruby/test_exception.rb =================================================================== --- ruby_1_9_3/test/ruby/test_exception.rb (revision 37550) +++ ruby_1_9_3/test/ruby/test_exception.rb (revision 37551) @@ -92,7 +92,16 @@ end false }) + end + def test_catch_throw_in_require + bug7185 = '[ruby-dev:46234]' + t = Tempfile.open(["dep", ".rb"]) + t.puts("throw :extdep, 42") + t.close + assert_equal(42, catch(:extdep) {require t.path}, bug7185) + ensure + t.close! if t end def test_else Property changes on: ruby_1_9_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r37270 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/