diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-17 04:23:06 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-17 04:23:06 +0000 |
commit | 13d3a280490bee122444b3398b6bd2a489c5ca08 (patch) | |
tree | 81da2bd46ba08322e1cc5b7004f73a921f4d0d1f | |
parent | 897b2177c19cf2f0dc956b9b868191f5f4d29112 (diff) |
merge revision(s) 47973: [Backport #10392]
* parse.y (parser_here_document): do not append already appended
and disposed code fragment. [ruby-dev:48647] [Bug #10392]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 5 | ||||
-rw-r--r-- | test/ripper/test_scanner_events.rb | 4 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Fri Oct 17 13:22:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (parser_here_document): do not append already appended + and disposed code fragment. [ruby-dev:48647] [Bug #10392] + Fri Oct 17 13:19:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/stringio/stringio.c (strio_write): ASCII-8BIT StringIO @@ -6458,7 +6458,10 @@ parser_here_document(struct parser_params *parser, NODE *here) if (pend < lex_pend) rb_str_cat(str, "\n", 1); lex_goto_eol(parser); if (nextc() == -1) { - if (str) dispose_string(str); + if (str) { + dispose_string(str); + str = 0; + } goto error; } } while (!whole_match_p(eos, len, indent)); diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb index a96edef063..cd7fa48e84 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -683,6 +683,10 @@ class TestRipper::ScannerEvents < Test::Unit::TestCase assert_equal ["there\n""heredoc", "\n"], scan('tstring_content', "<<""EOS\n""there\n""heredoc\#@foo\nEOS"), bug7255 + bug10392 = '[ruby-dev:48647] [Bug #10392]' + assert_equal [" E\n\n"], + scan('tstring_content', "<<""'E'\n E\n\n"), + bug10392 end def test_heredoc_end @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2014-10-17" -#define RUBY_PATCHLEVEL 589 +#define RUBY_PATCHLEVEL 590 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 10 |