ruby-changes:38178
From: nobu <ko1@a...>
Date: Sun, 12 Apr 2015 20:56:20 +0900 (JST)
Subject: [ruby-changes:38178] nobu:r50265 (trunk): parse.y: null by syntax error
nobu 2015-04-12 15:35:02 +0900 (Sun, 12 Apr 2015) New Revision: 50265 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50265 Log: parse.y: null by syntax error * parse.y (arg): fix segfault by null caused by syntax error. [ruby-core:68851] [Bug #10957] Modified files: trunk/ChangeLog trunk/parse.y trunk/test/ruby/test_syntax.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 50264) +++ ChangeLog (revision 50265) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Apr 12 15:34:59 2015 Nobuyoshi Nakada <nobu@r...> + + * parse.y (arg): fix segfault by null caused by syntax error. + [ruby-core:68851] [Bug #10957] + Sun Apr 12 15:11:16 2015 SHIBATA Hiroshi <shibata.hiroshi@g...> * lib/rubygems/test_case.rb: use explicitly exception class and reverted Index: parse.y =================================================================== --- parse.y (revision 50264) +++ parse.y (revision 50265) @@ -2103,7 +2103,7 @@ arg : lhs '=' arg https://github.com/ruby/ruby/blob/trunk/parse.y#L2103 value_expr($3); $$ = NEW_DOT2($1, $3); if ($1 && nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) && - nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) { + $3 && nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) { deferred_nodes = list_append(deferred_nodes, $$); } /*% @@ -2117,7 +2117,7 @@ arg : lhs '=' arg https://github.com/ruby/ruby/blob/trunk/parse.y#L2117 value_expr($3); $$ = NEW_DOT3($1, $3); if ($1 && nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) && - nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) { + $3 && nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) { deferred_nodes = list_append(deferred_nodes, $$); } /*% Index: test/ruby/test_syntax.rb =================================================================== --- test/ruby/test_syntax.rb (revision 50264) +++ test/ruby/test_syntax.rb (revision 50265) @@ -561,6 +561,8 @@ eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L561 bug10957 = '[ruby-core:68477] [Bug #10957]' assert_ruby_status(['-c', '-e', 'p ()..0'], "", bug10957) assert_ruby_status(['-c', '-e', 'p ()...0'], "", bug10957) + assert_syntax_error('0..%w.', /unterminated string/, bug10957) + assert_syntax_error('0...%w.', /unterminated string/, bug10957) end private -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/