diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | eval.c | 2 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Sat Feb 28 18:05:58 2009 Nobuyoshi Nakada <[email protected]> + + * 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]. + Fri Feb 27 17:45:25 2009 Nobuyoshi Nakada <[email protected]> * file.c (file_load_ok): checks if regular file, except for the @@ -3934,11 +3934,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: |