mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (dsym): prohibit empty symbol literal by interpolation.
fixed: [ruby-talk:166529] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e4b2293712
commit
cc24146adc
2 changed files with 12 additions and 2 deletions
|
@ -1,8 +1,11 @@
|
|||
Mon Nov 21 22:19:33 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Mon Nov 21 22:50:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* file.c (rb_path_skip_prefix, rb_file_s_basename): UNC without path
|
||||
should not be splitted. fixed: [ruby-dev:27776] [ruby-dev:27786]
|
||||
|
||||
* parse.y (dsym): prohibit empty symbol literal by interpolation.
|
||||
fixed: [ruby-talk:166529]
|
||||
|
||||
Mon Nov 21 16:03:48 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/setup.mk: findstr doesn't exist on win9x.
|
||||
|
|
9
parse.y
9
parse.y
|
@ -3864,12 +3864,19 @@ dsym : tSYMBEG xstring_contents tSTRING_END
|
|||
yyerror("empty symbol literal");
|
||||
}
|
||||
else {
|
||||
VALUE lit;
|
||||
|
||||
switch (nd_type($$)) {
|
||||
case NODE_DSTR:
|
||||
nd_set_type($$, NODE_DSYM);
|
||||
break;
|
||||
case NODE_STR:
|
||||
if (strlen(RSTRING($$->nd_lit)->ptr) == RSTRING($$->nd_lit)->len) {
|
||||
lit = $$->nd_lit;
|
||||
if (RSTRING(lit)->len == 0) {
|
||||
yyerror("empty symbol literal");
|
||||
break;
|
||||
}
|
||||
if (strlen(RSTRING(lit)->ptr) == RSTRING(lit)->len) {
|
||||
$$->nd_lit = ID2SYM(rb_intern(RSTRING($$->nd_lit)->ptr));
|
||||
nd_set_type($$, NODE_LIT);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue