summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 41c1d0678c..b81001b0ef 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -526,7 +526,8 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_call_info_t *ci, int is_attr)
}
if (UNLIKELY(val == Qundef)) {
- if (!is_attr) rb_warning("instance variable %s not initialized", rb_id2name(id));
+ if (!is_attr && RTEST(ruby_verbose))
+ rb_warning("instance variable %s not initialized", rb_id2name(id));
val = Qnil;
}
return val;