ruby-changes:22007
From: nagachika <ko1@a...>
Date: Thu, 15 Dec 2011 23:20:10 +0900 (JST)
Subject: [ruby-changes:22007] nagachika:r34056 (trunk): * error.c (builtin_type_name): don't return pointer to the buffer of
nagachika 2011-12-15 23:19:59 +0900 (Thu, 15 Dec 2011) New Revision: 34056 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34056 Log: * error.c (builtin_type_name): don't return pointer to the buffer of temporary String object. Modified files: trunk/ChangeLog trunk/error.c Index: ChangeLog =================================================================== --- ChangeLog (revision 34055) +++ ChangeLog (revision 34056) @@ -1,3 +1,8 @@ +Thu Dec 15 23:16:13 2011 CHIKANAGA Tomoyuki <nagachika00@g...> + + * error.c (builtin_type_name): don't return pointer to the buffer of + temporary String object. + Thu Dec 15 17:56:58 2011 Nobuyoshi Nakada <nobu@r...> * io.c (argf_type): make typed data. Index: error.c =================================================================== --- error.c (revision 34055) +++ error.c (revision 34056) @@ -392,10 +392,12 @@ else if (SYMBOL_P(x)) { etype = "Symbol"; } - else if (rb_special_const_p(x)) { - x = rb_obj_as_string(x); - etype = StringValuePtr(x); + else if (RB_TYPE_P(x, T_TRUE)) { + etype = "true"; } + else if (RB_TYPE_P(x, T_FALSE)) { + etype = "false"; + } else { etype = rb_obj_classname(x); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/