From 9b45b336ee97477b9c8a81143ee47c52d801412b Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 15 Jun 2008 09:17:06 +0000 Subject: * vm_core.h (rb_vm_t), vm.c (rb_vm_mark): moved preallocated special exceptions. * eval.c (Init_eval), gc.c (Init_GC), proc.c (Init_Proc): freeze preallocated special exceptions. * eval.c (rb_longjmp): duplicate the thrown exception to set backtrace if it was frozen. * gc.c (rb_memerror): raise nomem_error without backtrace if failed to make backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index bb1e43bb73..f6424372f7 100644 --- a/eval.c +++ b/eval.c @@ -20,9 +20,8 @@ NORETURN(void rb_raise_jump(VALUE)); ID rb_frame_callee(void); VALUE rb_eLocalJumpError; VALUE rb_eSysStackError; -VALUE sysstack_error; -static VALUE exception_error; +#define exception_error GET_VM()->special_exceptions[ruby_error_reenter] #include "eval_error.c" #include "eval_safe.c" @@ -372,6 +371,9 @@ rb_longjmp(int tag, VALUE mesg) at = get_backtrace(mesg); if (NIL_P(at)) { at = rb_make_backtrace(); + if (OBJ_FROZEN(mesg)) { + mesg = rb_obj_dup(mesg); + } set_backtrace(mesg, at); } } @@ -1198,7 +1200,8 @@ Init_eval(void) exception_error = rb_exc_new2(rb_eFatal, "exception reentered"); rb_ivar_set(exception_error, idThrowState, INT2FIX(TAG_FATAL)); - rb_register_mark_object(exception_error); + OBJ_TAINT(exception_error); + OBJ_FREEZE(exception_error); } -- cgit v1.2.3