1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (dsym): allow empty symbols. [ruby-core:15248]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-01-30 17:20:48 +00:00
parent 1df7138a0d
commit dd7bcfc072
2 changed files with 5 additions and 6 deletions

View file

@ -1,3 +1,7 @@
Thu Jan 31 02:15:49 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (dsym): allow empty symbols. [ruby-core:15248]
Thu Jan 31 00:01:51 2008 Tanaka Akira <akr@fsij.org> Thu Jan 31 00:01:51 2008 Tanaka Akira <akr@fsij.org>
* io.c (select_internal): fix SEGV by `select [STDIN],nil,[STDIN]'. * io.c (select_internal): fix SEGV by `select [STDIN],nil,[STDIN]'.

View file

@ -3868,8 +3868,7 @@ dsym : tSYMBEG xstring_contents tSTRING_END
/*%%%*/ /*%%%*/
lex_state = EXPR_ENDARG; lex_state = EXPR_ENDARG;
if (!($$ = $2)) { if (!($$ = $2)) {
$$ = NEW_NIL(); $$ = NEW_LIT(ID2SYM(rb_intern("")));
yyerror("empty symbol literal");
} }
else { else {
VALUE lit; VALUE lit;
@ -3880,10 +3879,6 @@ dsym : tSYMBEG xstring_contents tSTRING_END
break; break;
case NODE_STR: case NODE_STR:
lit = $$->nd_lit; lit = $$->nd_lit;
if (RSTRING_LEN(lit) == 0) {
yyerror("empty symbol literal");
break;
}
$$->nd_lit = ID2SYM(rb_intern_str(lit)); $$->nd_lit = ID2SYM(rb_intern_str(lit));
nd_set_type($$, NODE_LIT); nd_set_type($$, NODE_LIT);
break; break;