summaryrefslogtreecommitdiffstats
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
commit6990ad04e3c85f230c55fca732f922eba710bbf3 (patch)
treeb40d5a5f32138109f5c9b0006d6d90f6529a621e /eval.c
parent618565d594528a7b5ecee7942453307075215047 (diff)
downloadruby-6990ad04e3c85f230c55fca732f922eba710bbf3.tar.gz
ruby-6990ad04e3c85f230c55fca732f922eba710bbf3.tar.xz
ruby-6990ad04e3c85f230c55fca732f922eba710bbf3.zip
* 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: http://svn.ruby-lang.org/repos/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 bb1e43bb7..f6424372f 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);
}