diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-20 15:44:06 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-20 15:44:06 +0000 |
| commit | 40f22b00e77ac75c759279c94cb9482b303dec6c (patch) | |
| tree | 7be9c437cf2c4f4d6d05584ef3fca5e19bcab4a4 | |
| parent | c6f42424a7baa51a0db0695c2c368fc9d93fcfaa (diff) | |
| download | ruby-40f22b00e77ac75c759279c94cb9482b303dec6c.tar.gz ruby-40f22b00e77ac75c759279c94cb9482b303dec6c.tar.xz ruby-40f22b00e77ac75c759279c94cb9482b303dec6c.zip | |
* 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
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rw-r--r-- | io.c | 3 | ||||
| -rw-r--r-- | parse.y | 2 | ||||
| -rw-r--r-- | string.c | 3 |
4 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,12 @@ +Thu Oct 21 00:36:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org> + + * parse.y (lex_getline): should not touch ruby_debug_lines if + RIPPER is defined. [ruby-dev:24547] + +Wed Oct 20 19:45:13 2004 Yukihiro Matsumoto <matz@ruby-lang.org> + + * string.c (str_gsub): reentrant check. [ruby-dev:24432] + Wed Oct 20 12:42:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * io.c (rb_io_getline): rs modification check should not interfere @@ -1131,6 +1131,9 @@ io_readpartial(argc, argv, io) return str; READ_CHECK(fptr->f); + if (RSTRING(str)->len != len) { + rb_raise(rb_eRuntimeError, "buffer string modified"); + } n = read_buffered_data(RSTRING(str)->ptr, len, fptr->f); if (n <= 0) { again: @@ -4404,9 +4404,11 @@ lex_getline(parser) struct parser_params *parser; { VALUE line = (*parser->parser_lex_gets)(parser, parser->parser_lex_input); +#ifndef RIPPER if (ruby_debug_lines && !NIL_P(line)) { rb_ary_push(ruby_debug_lines, line); } +#endif return line; } @@ -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 { |
