diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | version.h | 2 | ||||
-rw-r--r-- | vm_insnhelper.c | 4 |
3 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Sat Feb 19 22:37:42 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com> + + * vm_insnhelper.c (vm_check_if_namespace): guard temporary object + from GC. + Fri Feb 18 00:28:39 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com> * compile.c (get_exception_sym2type): guard temporary object from GC. @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 202 +#define RUBY_PATCHLEVEL 203 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 00856d38ee..9f2d050ec7 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1134,13 +1134,15 @@ vm_get_const_base(const rb_iseq_t *iseq, const VALUE *lfp, const VALUE *dfp) static inline void vm_check_if_namespace(VALUE klass) { + VALUE str; switch (TYPE(klass)) { case T_CLASS: case T_MODULE: break; default: + str = rb_inspect(klass); rb_raise(rb_eTypeError, "%s is not a class/module", - RSTRING_PTR(rb_inspect(klass))); + RSTRING_PTR(RB_GC_GUARD(str))); } } |