From 40f22b00e77ac75c759279c94cb9482b303dec6c Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 20 Oct 2004 15:44:06 +0000 Subject: * parse.y (lex_getline): should not touch ruby_debug_lines if RIPPER is defined. [ruby-dev:24547] * string.c (str_gsub): reentrant check. [ruby-dev:24432] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index af2354708..e2f7fab1e 100644 --- a/string.c +++ b/string.c @@ -2048,6 +2048,9 @@ str_gsub(argc, argv, str, bang) if (iter) { rb_match_busy(match); val = rb_obj_as_string(rb_yield(rb_reg_nth_match(0, match))); + if (RSTRING(str)->ptr == buf) { + rb_raise(rb_eRuntimeError, "gsub reentered"); + } rb_backref_set(match); } else { -- cgit