From e7c0a6e1d745935460a226cd5f29e2f0faff5417 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 20 Feb 2011 07:23:55 +0000 Subject: * prevent temporary objects from GC, and should not use RSTRING_PTR() for function calls since it evaluates the argument a couple of times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- error.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'error.c') diff --git a/error.c b/error.c index ca563722ba..b89818337e 100644 --- a/error.c +++ b/error.c @@ -356,7 +356,8 @@ rb_check_type(VALUE x, int t) etype = "Symbol"; } else if (rb_special_const_p(x)) { - etype = RSTRING_PTR(rb_obj_as_string(x)); + x = rb_obj_as_string(x); + etype = StringValuePtr(x); } else { etype = rb_obj_classname(x); -- cgit v1.2.3