summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-03 11:59:59 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-03 11:59:59 +0000
commit7686f4cd0ebe299db0bc380489fd6783a14b0572 (patch)
tree07b57201258533572c61bbdddefb55999fd9d32d /eval.c
parentc852a64cc7308d0b060083ad8dfc218b33f7996e (diff)
merge revision(s) 22674:
* eval.c (rb_eval): needs to guard intermediate string objects. based on a patch from Brent Roman <brent AT mbari.org> a [ruby-core:22584]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index d53101ca6e..7308409df1 100644
--- a/eval.c
+++ b/eval.c
@@ -3898,11 +3898,13 @@ rb_eval(self, n)
case NODE_DREGX:
result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
node->nd_cflag);
+ RB_GC_GUARD(str); /* ensure str is not GC'd in rb_reg_new */
break;
case NODE_DREGX_ONCE: /* regexp expand once */
result = rb_reg_new(RSTRING(str)->ptr, RSTRING(str)->len,
node->nd_cflag);
nd_set_type(node, NODE_LIT);
+ RB_GC_GUARD(str); /* ensure str is not GC'd in rb_reg_new */
node->nd_lit = result;
break;
case NODE_LIT: