From 7686f4cd0ebe299db0bc380489fd6783a14b0572 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Wed, 3 Jun 2009 11:59:59 +0000 Subject: merge revision(s) 22674: * eval.c (rb_eval): needs to guard intermediate string objects. based on a patch from Brent Roman 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 --- eval.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'eval.c') 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: -- cgit v1.2.3