diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-02 22:03:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-02 22:03:24 +0000 |
commit | 86c58b7813ffec29dcdb243e42f93dc33b5ba132 (patch) | |
tree | a83648ff8c2b03c459e745ac6d1604348e4dc698 | |
parent | a9d25a31ee8d36766163744da57d287a86e1ce18 (diff) |
* error.c (rb_exc_new3): keeps the given string itself.
* eval.c (Init_Proc), gc.c (Init_GC): freeze messages of preallocated
special exceptions also.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | error.c | 2 | ||||
-rw-r--r-- | eval.c | 6 | ||||
-rw-r--r-- | gc.c | 3 |
4 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,10 @@ +Thu Jul 3 07:03:22 2008 Nobuyoshi Nakada <[email protected]> + + * error.c (rb_exc_new3): keeps the given string itself. + + * eval.c (Init_Proc), gc.c (Init_GC): freeze messages of preallocated + special exceptions also. + Thu Jul 3 06:17:23 2008 Nobuyoshi Nakada <[email protected]> * eval.c (rb_longjmp): duplicate the thrown exception to set backtrace @@ -333,7 +333,7 @@ rb_exc_new3(etype, str) VALUE etype, str; { StringValue(str); - return rb_exc_new(etype, RSTRING(str)->ptr, RSTRING(str)->len); + return rb_funcall(etype, rb_intern("new"), 1, str); } /* @@ -9992,13 +9992,15 @@ Init_Proc() rb_define_method(rb_eLocalJumpError, "reason", localjump_reason, 0); rb_global_variable(&exception_error); - exception_error = rb_exc_new2(rb_eFatal, "exception reentered"); + exception_error = rb_exc_new3(rb_eFatal, + rb_obj_freeze(rb_str_new2("exception reentered"))); OBJ_TAINT(exception_error); OBJ_FREEZE(exception_error); rb_eSysStackError = rb_define_class("SystemStackError", rb_eStandardError); rb_global_variable(&sysstack_error); - sysstack_error = rb_exc_new2(rb_eSysStackError, "stack level too deep"); + sysstack_error = rb_exc_new3(rb_eSysStackError, + rb_obj_freeze(rb_str_new2("stack level too deep"))); OBJ_TAINT(sysstack_error); OBJ_FREEZE(sysstack_error); @@ -2125,7 +2125,8 @@ Init_GC() source_filenames = st_init_strtable(); rb_global_variable(&nomem_error); - nomem_error = rb_exc_new2(rb_eNoMemError, "failed to allocate memory"); + nomem_error = rb_exc_new3(rb_eNoMemError, + rb_obj_freeze(rb_str_new2"failed to allocate memory")); OBJ_TAINT(nomem_error); OBJ_FREEZE(nomem_error); |