summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-20 07:23:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-20 07:23:55 +0000
commite7c0a6e1d745935460a226cd5f29e2f0faff5417 (patch)
tree29840d1c3aa365cd3811d191370477c35474d37e /vm_eval.c
parent4ab39d2202c42d3781e44ad8b8219e6e5bfa39aa (diff)
* 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
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm_eval.c b/vm_eval.c
index 0dcbafad21..ce7057476c 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1015,7 +1015,8 @@ eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char
th->base_block = 0;
if (0) { /* for debug */
- printf("%s\n", RSTRING_PTR(rb_iseq_disasm(iseqval)));
+ VALUE disasm = rb_iseq_disasm(iseqval);
+ printf("%s\n", StringValuePtr(disasm));
}
/* save new env */