Skip to content

Commit 0eded3c

Browse files
committed
merge revision(s) r49964: [Backport ruby#10957]
* parse.y (primary): empty parentheses at cmdarg can be null. [ruby-core:68477] [Bug ruby#10957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 85f3339 commit 0eded3c

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Tue Mar 31 00:18:12 2015 Nobuyoshi Nakada <[email protected]>
2+
3+
* parse.y (primary): empty parentheses at cmdarg can be null.
4+
[ruby-core:68477] [Bug #10957]
5+
16
Mon Mar 30 23:30:57 2015 Nobuyoshi Nakada <[email protected]>
27

38
* ext/io/console/console.c (console_dev): id_console is not a

parse.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ arg : lhs '=' arg
20462046
value_expr($1);
20472047
value_expr($3);
20482048
$$ = NEW_DOT2($1, $3);
2049-
if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
2049+
if ($1 && nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
20502050
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
20512051
deferred_nodes = list_append(deferred_nodes, $$);
20522052
}
@@ -2060,7 +2060,7 @@ arg : lhs '=' arg
20602060
value_expr($1);
20612061
value_expr($3);
20622062
$$ = NEW_DOT3($1, $3);
2063-
if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
2063+
if ($1 && nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
20642064
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
20652065
deferred_nodes = list_append(deferred_nodes, $$);
20662066
}

test/ruby/test_syntax.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,12 @@ def test_error_message_encoding
408408
assert_syntax_error(code, /def n "\u{2208}"; end/, bug10114)
409409
end
410410

411+
def test_null_range_cmdarg
412+
bug10957 = '[ruby-core:68477] [Bug #10957]'
413+
assert_ruby_status(['-c', '-e', 'p ()..0'], "", bug10957)
414+
assert_ruby_status(['-c', '-e', 'p ()...0'], "", bug10957)
415+
end
416+
411417
private
412418

413419
def not_label(x) @result = x; @not_label ||= nil end

version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#define RUBY_VERSION "2.1.5"
2-
#define RUBY_RELEASE_DATE "2015-03-30"
3-
#define RUBY_PATCHLEVEL 323
2+
#define RUBY_RELEASE_DATE "2015-03-31"
3+
#define RUBY_PATCHLEVEL 324
44

55
#define RUBY_RELEASE_YEAR 2015
66
#define RUBY_RELEASE_MONTH 3
7-
#define RUBY_RELEASE_DAY 30
7+
#define RUBY_RELEASE_DAY 31
88

99
#include "ruby/version.h"
1010

0 commit comments

Comments
 (0)