diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-04 05:57:35 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-04 05:57:35 +0000 |
commit | 9e0a2170fd9ae9ee3a7545630a685a4a3e2f795a (patch) | |
tree | e3dd013eafb76c6d89373053bf835a98b8ced5ba | |
parent | 65e965a12ff85b06dd111d821465cc95cb6e00da (diff) | |
download | ruby-9e0a2170fd9ae9ee3a7545630a685a4a3e2f795a.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | parse.y | 16 |
2 files changed, 15 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Mon Sep 4 06:46:08 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * parse.y (rb_id2sym): intern if id is attrset_id. + [ruby-dev:29420] [ruby-dev:29447] + Mon Sep 4 01:25:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * eval.c (rb_f_local_variables): list symbols. @@ -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 |