diff options
-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 | 6 |
4 files changed, 16 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Sun Oct 19 03:13:38 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] + Thu Oct 16 22:10:11 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/stringio/stringio.c (strio_write): ASCII-8BIT StringIO @@ -6547,7 +6547,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 2474588f76..d444bb1042 100644 --- a/test/ripper/test_scanner_events.rb +++ b/test/ripper/test_scanner_events.rb @@ -708,6 +708,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,10 +1,10 @@ #define RUBY_VERSION "2.1.4" -#define RUBY_RELEASE_DATE "2014-10-16" -#define RUBY_PATCHLEVEL 259 +#define RUBY_RELEASE_DATE "2014-10-19" +#define RUBY_PATCHLEVEL 260 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 10 -#define RUBY_RELEASE_DAY 16 +#define RUBY_RELEASE_DAY 19 #include "ruby/version.h" |