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 --- io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 33c97a68d3..82b8469d40 100644 --- a/io.c +++ b/io.c @@ -7498,8 +7498,9 @@ advice_arg_check(VALUE advice) advice != sym_willneed && advice != sym_dontneed && advice != sym_noreuse) { - rb_raise(rb_eNotImpError, "Unsupported advice: :%s", - RSTRING_PTR(rb_id2str(SYM2ID(advice)))); + VALUE symname = rb_inspect(advice); + rb_raise(rb_eNotImpError, "Unsupported advice: %s", + StringValuePtr(symname)); } } -- cgit v1.2.3