summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ruby/test_module.rb5
-rw-r--r--vm_insnhelper.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index f025c1948e..5a0d819fb7 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1826,6 +1826,11 @@ class TestModule < Test::Unit::TestCase
assert_warning '' do
assert_equal(42, a.ivar)
end
+
+ name = "@\u{5909 6570}"
+ assert_warning(/instance variable #{name} not initialized/) do
+ assert_nil(a.instance_eval(name))
+ end
end
def test_uninitialized_attr
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index b81001b0ef..495b7224fd 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -527,7 +527,7 @@ vm_getivar(VALUE obj, ID id, IC ic, rb_call_info_t *ci, int is_attr)
if (UNLIKELY(val == Qundef)) {
if (!is_attr && RTEST(ruby_verbose))
- rb_warning("instance variable %s not initialized", rb_id2name(id));
+ rb_warning("instance variable %"PRIsVALUE" not initialized", QUOTE_ID(id));
val = Qnil;
}
return val;