summaryrefslogtreecommitdiff
path: root/ext/json/generator
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-09 08:31:27 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-09 08:31:27 +0900
commit2a8be8ec33a238410e58864f59b6ffccfd0cc19d (patch)
tree4801784b208959559425ecb7376b2a14ff303f5a /ext/json/generator
parentad38f026457304d677fde5dfa0d4d256fd4d6509 (diff)
Suppress uninitialized instance variable warnings
Diffstat (limited to 'ext/json/generator')
-rw-r--r--ext/json/generator/generator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/generator/generator.c b/ext/json/generator/generator.c
index e59a1200084..036205d7cbb 100644
--- a/ext/json/generator/generator.c
+++ b/ext/json/generator/generator.c
@@ -692,7 +692,7 @@ static VALUE cState_aref(VALUE self, VALUE name)
if (RTEST(rb_funcall(self, i_respond_to_p, 1, name))) {
return rb_funcall(self, i_send, 1, name);
} else {
- return rb_ivar_get(self, rb_intern_str(rb_str_concat(rb_str_new2("@"), name)));
+ return rb_attr_get(self, rb_intern_str(rb_str_concat(rb_str_new2("@"), name)));
}
}