ruby-changes:18891
From: nagachika <ko1@a...>
Date: Sat, 19 Feb 2011 22:41:27 +0900 (JST)
Subject: [ruby-changes:18891] Ruby:r30916 (trunk): * vm_insnhelper.c (vm_check_if_namespace): guard temporary object
nagachika 2011-02-19 22:41:19 +0900 (Sat, 19 Feb 2011) New Revision: 30916 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30916 Log: * vm_insnhelper.c (vm_check_if_namespace): guard temporary object from GC. Modified files: trunk/ChangeLog trunk/vm_insnhelper.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30915) +++ ChangeLog (revision 30916) @@ -1,3 +1,8 @@ +Sat Feb 19 22:37:42 2011 CHIKANAGA Tomoyuki <nagachika00@g...> + + * vm_insnhelper.c (vm_check_if_namespace): guard temporary object + from GC. + Sat Feb 19 06:36:27 2011 Aaron Patterson <aaron@t...> * lib/test/unit.rb: partial revert of r30849. [ruby-core:32864] Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 30915) +++ vm_insnhelper.c (revision 30916) @@ -1135,13 +1135,15 @@ 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))); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/