summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 05:57:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 05:57:35 +0000
commit9e0a2170fd9ae9ee3a7545630a685a4a3e2f795a (patch)
treee3dd013eafb76c6d89373053bf835a98b8ced5ba /parse.y
parent65e965a12ff85b06dd111d821465cc95cb6e00da (diff)
* parse.y (rb_id2sym): intern if id is attrset_id.
[ruby-dev:29420] [ruby-dev:29447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y16
1 files changed, 10 insertions, 6 deletions
diff --git a/parse.y b/parse.y
index 34d1183777..6637bba246 100644
--- a/parse.y
+++ b/parse.y
@@ -7884,7 +7884,10 @@ arg_blk_pass(NODE *node1, NODE *node2)
static int
arg_dup_check(ID vid, VALUE m, VALUE list, NODE *node)
{
- VALUE sym = ID2SYM(vid);
+ VALUE sym;
+
+ if (!vid) return 0;
+ sym = ID2SYM(vid);
if ((m && rb_ary_includes(m, sym)) || rb_ary_includes(list, sym)) {
ruby_sourceline = nd_line(node);
return 1;
@@ -8468,12 +8471,13 @@ rb_id2sym(ID id)
{
VALUE data;
- if (st_lookup(global_symbols.id_sym, id, &data)) {
- if (!RBASIC(data)->klass) {
- RBASIC(data)->klass = rb_cSymbol;
- }
- return data;
+ while (!st_lookup(global_symbols.id_sym, id, &data)) {
+ rb_id2name(id);
+ }
+ if (!RBASIC(data)->klass) {
+ RBASIC(data)->klass = rb_cSymbol;
}
+ return data;
}
ID