diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-13 07:41:24 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-13 07:41:24 +0000 |
commit | 485267354273fc2ca2c9b1f22e39c5f1f414f4ca (patch) | |
tree | e5f250f60ef664363107833593389c37bad852f8 | |
parent | ab4c4d3e2b293cb40ca6a5f2a233ae3b5747e184 (diff) |
merge revision(s) 50265: [Backport #10957]
* parse.y (arg): fix segfault by null caused by syntax error.
[ruby-core:68851] [Bug #10957]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 4 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 2 | ||||
-rw-r--r-- | version.h | 8 |
4 files changed, 13 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Mon Apr 13 16:39:57 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (arg): fix segfault by null caused by syntax error. + [ruby-core:68851] [Bug #10957] + Tue Mar 31 00:49:23 2015 Naohisa Goto <ngotogenome@gmail.com> * gc.c (wmap_final_func): fix memory size shortage when realloc wmap. @@ -2047,7 +2047,7 @@ arg : lhs '=' arg 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, $$); } /*% @@ -2061,7 +2061,7 @@ arg : lhs '=' arg 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, $$); } /*% diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index c94a8c68e1..692763ef98 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -412,6 +412,8 @@ eom 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 @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.1.5" -#define RUBY_RELEASE_DATE "2015-03-31" -#define RUBY_PATCHLEVEL 329 +#define RUBY_RELEASE_DATE "2015-04-13" +#define RUBY_PATCHLEVEL 330 #define RUBY_RELEASE_YEAR 2015 -#define RUBY_RELEASE_MONTH 3 -#define RUBY_RELEASE_DAY 31 +#define RUBY_RELEASE_MONTH 4 +#define RUBY_RELEASE_DAY 13 #include "ruby/version.h" |