ruby-changes:12448
From: nobu <ko1@a...>
Date: Thu, 16 Jul 2009 18:28:30 +0900 (JST)
Subject: [ruby-changes:12448] Ruby:r24148 (trunk): * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer
nobu 2009-07-16 18:28:12 +0900 (Thu, 16 Jul 2009) New Revision: 24148 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24148 Log: * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer used. [ruby-dev:38760] Modified files: trunk/ChangeLog trunk/eval.c trunk/id.c trunk/id.h trunk/parse.y trunk/test/ruby/test_exception.rb trunk/vm.c Index: ChangeLog =================================================================== --- ChangeLog (revision 24147) +++ ChangeLog (revision 24148) @@ -1,3 +1,8 @@ +Thu Jul 16 18:28:09 2009 Nobuyoshi Nakada <nobu@r...> + + * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer + used. [ruby-dev:38760] + Thu Jul 16 17:41:28 2009 Koichi Sasada <ko1@a...> * vm_method.c (rb_alias): fix a case which try non-existing method alias. Index: eval.c =================================================================== --- eval.c (revision 24147) +++ eval.c (revision 24148) @@ -1063,7 +1063,6 @@ exception_error = rb_exc_new3(rb_eFatal, rb_obj_freeze(rb_str_new2("exception reentered"))); - rb_ivar_set(exception_error, idThrowState, INT2FIX(TAG_FATAL)); OBJ_TAINT(exception_error); OBJ_FREEZE(exception_error); } Index: id.c =================================================================== --- id.c (revision 24147) +++ id.c (revision 24148) @@ -24,7 +24,6 @@ REGISTER_SYMID(idIFUNC, "<IFUNC>"); REGISTER_SYMID(idCFUNC, "<CFUNC>"); REGISTER_SYMID(idRespond_to, "respond_to?"); - REGISTER_SYMID(idThrowState, "#__ThrowState__"); REGISTER_SYMID(id_core_set_method_alias, "core#set_method_alias"); REGISTER_SYMID(id_core_set_variable_alias, "core#set_variable_alias"); Index: parse.y =================================================================== --- parse.y (revision 24147) +++ parse.y (revision 24148) @@ -746,7 +746,6 @@ %nonassoc idRespond_to %nonassoc idIFUNC %nonassoc idCFUNC -%nonassoc idThrowState %nonassoc id_core_set_method_alias %nonassoc id_core_set_variable_alias %nonassoc id_core_undef_method Index: id.h =================================================================== --- id.h (revision 24147) +++ id.h (revision 24148) @@ -61,14 +61,13 @@ idRespond_to = 366, idIFUNC = 367, idCFUNC = 368, - idThrowState = 369, - id_core_set_method_alias = 370, - id_core_set_variable_alias = 371, - id_core_undef_method = 372, - id_core_define_method = 373, - id_core_define_singleton_method = 374, - id_core_set_postexe = 375, - tLAST_TOKEN = 376, + id_core_set_method_alias = 369, + id_core_set_variable_alias = 370, + id_core_undef_method = 371, + id_core_define_method = 372, + id_core_define_singleton_method = 373, + id_core_set_postexe = 374, + tLAST_TOKEN = 375, #endif idDot2 = tDOT2, idDot3 = tDOT3, @@ -156,14 +155,13 @@ ruby_method_id_check_for(idRespond_to, 366); ruby_method_id_check_for(idIFUNC, 367); ruby_method_id_check_for(idCFUNC, 368); -ruby_method_id_check_for(idThrowState, 369); -ruby_method_id_check_for(id_core_set_method_alias, 370); -ruby_method_id_check_for(id_core_set_variable_alias, 371); -ruby_method_id_check_for(id_core_undef_method, 372); -ruby_method_id_check_for(id_core_define_method, 373); -ruby_method_id_check_for(id_core_define_singleton_method, 374); -ruby_method_id_check_for(id_core_set_postexe, 375); -ruby_method_id_check_for(tLAST_TOKEN, 376); +ruby_method_id_check_for(id_core_set_method_alias, 369); +ruby_method_id_check_for(id_core_set_variable_alias, 370); +ruby_method_id_check_for(id_core_undef_method, 371); +ruby_method_id_check_for(id_core_define_method, 372); +ruby_method_id_check_for(id_core_define_singleton_method, 373); +ruby_method_id_check_for(id_core_set_postexe, 374); +ruby_method_id_check_for(tLAST_TOKEN, 375); }; #endif Index: vm.c =================================================================== --- vm.c (revision 24147) +++ vm.c (revision 24148) @@ -1113,11 +1113,6 @@ err = th->errinfo; - if (state == TAG_RAISE) { - if (OBJ_FROZEN(err)) rb_exc_raise(err); - rb_ivar_set(err, idThrowState, INT2FIX(state)); - } - exception_handler: cont_pc = cont_sp = catch_iseqval = 0; Index: test/ruby/test_exception.rb =================================================================== --- test/ruby/test_exception.rb (revision 24147) +++ test/ruby/test_exception.rb (revision 24148) @@ -223,4 +223,23 @@ end INPUT end + + def test_safe4 + cmd = proc{raise SystemExit} + safe0_p = proc{|*args| args} + + test_proc = proc { + $SAFE = 4 + begin + cmd.call + rescue SystemExit => e + safe0_p["SystemExit: #{e.inspect}"] + raise e + rescue Exception => e + safe0_p["Exception (NOT SystemExit): #{e.inspect}"] + raise e + end + } + assert_raise(SystemExit, '[ruby-dev:38760]') {test_proc.call} + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/