aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-13 02:16:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-13 02:16:27 +0000
commitb1d5c752fbafe0433508e6719d576072fd938e01 (patch)
tree752643eb9d7d0dcc855cafbc6563134d3139db00 /parse.y
parent6dcf9f16ccf2523e9473b10d8b8f308013913c57 (diff)
downloadruby-b1d5c752fbafe0433508e6719d576072fd938e01.tar.gz
* parse.y (dsym): convert also literals containing NUL to
symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y9
1 files changed, 3 insertions, 6 deletions
diff --git a/parse.y b/parse.y
index 23f2aef3d1..70c0850b37 100644
--- a/parse.y
+++ b/parse.y
@@ -3864,12 +3864,9 @@ dsym : tSYMBEG xstring_contents tSTRING_END
yyerror("empty symbol literal");
break;
}
- if (strlen(RSTRING_PTR(lit)) == RSTRING_LEN(lit)) {
- $$->nd_lit = ID2SYM(rb_intern(RSTRING_PTR($$->nd_lit)));
- nd_set_type($$, NODE_LIT);
- break;
- }
- /* fall through */
+ $$->nd_lit = ID2SYM(rb_intern2(RSTRING_PTR(lit), RSTRING_LEN(lit)));
+ nd_set_type($$, NODE_LIT);
+ break;
default:
$$ = NEW_NODE(NODE_DSYM, rb_str_new(0, 0), 1, NEW_LIST($$));
break;