From 63e8110bfc153acc858dbe51017fbb2395f559d7 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 3 Apr 2012 01:18:31 +0000 Subject: * enumerator.c (inspect_enumerator): suppress uninitialized instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enumerator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'enumerator.c') diff --git a/enumerator.c b/enumerator.c index 3f50e9563c..ef1d9ccfbc 100644 --- a/enumerator.c +++ b/enumerator.c @@ -875,7 +875,7 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur) return str; } - eobj = rb_iv_get(obj, "receiver"); + eobj = rb_attr_get(obj, rb_intern("receiver")); if (NIL_P(eobj)) { eobj = e->obj; } @@ -886,7 +886,7 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur) /* (1..100).each_cons(2) => "#" */ str = rb_sprintf("#<%s: ", cname); rb_str_concat(str, rb_inspect(eobj)); - method = rb_iv_get(obj, "method"); + method = rb_attr_get(obj, rb_intern("method")); if (NIL_P(method)) { rb_str_buf_cat2(str, ":"); rb_str_buf_cat2(str, rb_id2name(e->meth)); @@ -897,7 +897,7 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur) rb_str_buf_cat2(str, rb_id2name(SYM2ID(method))); } - eargs = rb_iv_get(obj, "arguments"); + eargs = rb_attr_get(obj, rb_intern("arguments")); if (NIL_P(eargs)) { eargs = e->args; } -- cgit v1.2.3