From 415d5ebc2f96e04fea438cd86ad23aa94a0e1da2 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 16 Jul 2009 09:28:12 +0000 Subject: * id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer used. [ruby-dev:38760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ eval.c | 1 - id.c | 1 - id.h | 30 ++++++++++++++---------------- parse.y | 1 - test/ruby/test_exception.rb | 19 +++++++++++++++++++ vm.c | 5 ----- 7 files changed, 38 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8b7d86b75..02eaf07770 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 16 18:28:09 2009 Nobuyoshi Nakada + + * 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 * vm_method.c (rb_alias): fix a case which try non-existing method alias. diff --git a/eval.c b/eval.c index 67d9873810..6d6b6acd00 100644 --- a/eval.c +++ b/eval.c @@ -1063,7 +1063,6 @@ Init_eval(void) 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); } diff --git a/id.c b/id.c index 24a1959d6f..4fd760af03 100644 --- a/id.c +++ b/id.c @@ -24,7 +24,6 @@ Init_id(void) REGISTER_SYMID(idIFUNC, ""); REGISTER_SYMID(idCFUNC, ""); 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"); diff --git a/id.h b/id.h index cd45012268..1f94dbb996 100644 --- a/id.h +++ b/id.h @@ -61,14 +61,13 @@ enum ruby_method_ids { 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(idNULL, 365); 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 diff --git a/parse.y b/parse.y index be99da019a..4636b4de30 100644 --- a/parse.y +++ b/parse.y @@ -746,7 +746,6 @@ static void token_info_pop(struct parser_params*, const char *token); %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 diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index cba88f5c90..1eaeb7b3fb 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -223,4 +223,23 @@ class TestException < Test::Unit::TestCase 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 diff --git a/vm.c b/vm.c index 8b492faa3d..2a1a98198c 100644 --- a/vm.c +++ b/vm.c @@ -1113,11 +1113,6 @@ vm_exec(rb_thread_t *th) 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; -- cgit v1.2.3