From 360e6e5e121891088da04ebc297e8a611f14d16f Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 26 Jul 2006 07:43:16 +0000 Subject: * string.c (rb_str_scan): add string modification check. [ruby-core:7216] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index 62c494ac7..fb8be9dca 100644 --- a/string.c +++ b/string.c @@ -4255,6 +4255,7 @@ rb_str_scan(str, pat) VALUE result; long start = 0; VALUE match = Qnil; + char *p = RSTRING(str)->ptr; long len = RSTRING(str)->len; pat = get_pat(pat, 1); if (!rb_block_given_p()) { @@ -4272,6 +4273,7 @@ rb_str_scan(str, pat) match = rb_backref_get(); rb_match_busy(match); rb_yield(result); + str_mod_check(str, p, len); rb_backref_set(match); /* restore $~ value */ } rb_backref_set(match); -- cgit