summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 09:17:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-15 09:17:06 +0000
commit9b45b336ee97477b9c8a81143ee47c52d801412b (patch)
treeb40d5a5f32138109f5c9b0006d6d90f6529a621e /eval.c
parente7a660a3cfe9a8747b0a5f5b0c88019f5a19bbce (diff)
* 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
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c9
1 files changed, 6 insertions, 3 deletions
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);
}