зеркало из https://github.com/github/ruby.git
parse.y: do not use disposed string
* 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/trunk@47973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
eec651a05e
Коммит
04e5c65ff7
|
@ -1,3 +1,8 @@
|
|||
Thu Oct 16 15:05:07 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 10:35:33 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* test/-ext-/bug_reporter/test_bug_reporter.rb
|
||||
|
|
5
parse.y
5
parse.y
|
@ -6575,7 +6575,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));
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче