diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-12-12 09:07:35 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-12-12 09:07:35 +0000 |
| commit | fc4dc85900a25dc1bfa33b1b2ea290e96ecd1890 (patch) | |
| tree | 6e515c8c7cba0bdc099a1cf51a962b556a10f202 | |
| parent | e9c20dacbffe6372b6df9627b698bdff1c9642d0 (diff) | |
* parse.y (str_extend): make up pushback call.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | parse.y | 1 | ||||
| -rw-r--r-- | variable.c | 8 |
3 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,7 @@ +Mon Dec 10 17:40:02 2001 K.Kosako <kosako@sofnec.co.jp> + + * parse.y (str_extend): make up pushback call. + Mon Dec 10 01:06:56 2001 Yukihiro Matsumoto <matz@ruby-lang.org> * parse.y (gettable): should freeze __FILE__ string. @@ -3772,6 +3772,7 @@ str_extend(list, term, paren) goto refetch; } if (!is_identchar(c)) { + pushback(c); invalid_interporate: { VALUE s = rb_str_new2("#"); diff --git a/variable.c b/variable.c index 4798b961cc..e2d9451182 100644 --- a/variable.c +++ b/variable.c @@ -142,13 +142,15 @@ classname(klass) VALUE path = Qnil; ID classpath = rb_intern("__classpath__"); + if (TYPE(klass) == T_ICLASS) { + klass = RBASIC(klass)->klass; + } while (TYPE(klass) == T_ICLASS || FL_TEST(klass, FL_SINGLETON)) { klass = (VALUE)RCLASS(klass)->super; } if (!klass) klass = rb_cObject; - if (!ROBJECT(klass)->iv_tbl) - ROBJECT(klass)->iv_tbl = st_init_numtable(); - else if (!st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) { + if (ROBJECT(klass)->iv_tbl && + !st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) { ID classid = rb_intern("__classid__"); if (st_lookup(ROBJECT(klass)->iv_tbl, classid, &path)) { |
