summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-13 07:41:24 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-13 07:41:24 +0000
commit485267354273fc2ca2c9b1f22e39c5f1f414f4ca (patch)
treee5f250f60ef664363107833593389c37bad852f8
parentab4c4d3e2b293cb40ca6a5f2a233ae3b5747e184 (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--ChangeLog5
-rw-r--r--parse.y4
-rw-r--r--test/ruby/test_syntax.rb2
-rw-r--r--version.h8
4 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 3745a2d304..013ef036ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/parse.y b/parse.y
index 277998ce15..d091a0e6ef 100644
--- a/parse.y
+++ b/parse.y
@@ -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
diff --git a/version.h b/version.h
index 1a570a8e5b..59a5249cee 100644
--- a/version.h
+++ b/version.h
@@ -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"