Skip to content

Commit 4852673

Browse files
committed
merge revision(s) 50265: [Backport ruby#10957]
* parse.y (arg): fix segfault by null caused by syntax error. [ruby-core:68851] [Bug ruby#10957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent ab4c4d3 commit 4852673

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Mon Apr 13 16:39:57 2015 Nobuyoshi Nakada <[email protected]>
2+
3+
* parse.y (arg): fix segfault by null caused by syntax error.
4+
[ruby-core:68851] [Bug #10957]
5+
16
Tue Mar 31 00:49:23 2015 Naohisa Goto <[email protected]>
27

38
* gc.c (wmap_final_func): fix memory size shortage when realloc wmap.

parse.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ arg : lhs '=' arg
20472047
value_expr($3);
20482048
$$ = NEW_DOT2($1, $3);
20492049
if ($1 && nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
2050-
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
2050+
$3 && nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
20512051
deferred_nodes = list_append(deferred_nodes, $$);
20522052
}
20532053
/*%
@@ -2061,7 +2061,7 @@ arg : lhs '=' arg
20612061
value_expr($3);
20622062
$$ = NEW_DOT3($1, $3);
20632063
if ($1 && nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
2064-
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
2064+
$3 && nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
20652065
deferred_nodes = list_append(deferred_nodes, $$);
20662066
}
20672067
/*%

test/ruby/test_syntax.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ def test_null_range_cmdarg
412412
bug10957 = '[ruby-core:68477] [Bug #10957]'
413413
assert_ruby_status(['-c', '-e', 'p ()..0'], "", bug10957)
414414
assert_ruby_status(['-c', '-e', 'p ()...0'], "", bug10957)
415+
assert_syntax_error('0..%w.', /unterminated string/, bug10957)
416+
assert_syntax_error('0...%w.', /unterminated string/, bug10957)
415417
end
416418

417419
private

version.h

Lines changed: 4 additions & 4 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-31"
3-
#define RUBY_PATCHLEVEL 329
2+
#define RUBY_RELEASE_DATE "2015-04-13"
3+
#define RUBY_PATCHLEVEL 330
44

55
#define RUBY_RELEASE_YEAR 2015
6-
#define RUBY_RELEASE_MONTH 3
7-
#define RUBY_RELEASE_DAY 31
6+
#define RUBY_RELEASE_MONTH 4
7+
#define RUBY_RELEASE_DAY 13
88

99
#include "ruby/version.h"
1010

0 commit comments

Comments
 (0)