From d31611574835771733101fee216bc296fae052a6 Mon Sep 17 00:00:00 2001 From: cubicdaiya Date: Wed, 26 Feb 2014 13:50:51 +0900 Subject: fix bug for get_valid_iv_sym When sub-string is used in the following way, it does not work well. o = Object.new o.instance_variable_set(:@a, 1) o.instance_variable_defined?("@abc"[0,2]) #=> false (this should be true) --- src/kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel.c b/src/kernel.c index 25863c897..e61a602be 100644 --- a/src/kernel.c +++ b/src/kernel.c @@ -585,7 +585,7 @@ get_valid_iv_sym(mrb_state *mrb, mrb_value iv_name) mrb_assert(mrb_symbol_p(iv_name) || mrb_string_p(iv_name)); if (mrb_string_p(iv_name)) { - iv_name_id = mrb_intern_cstr(mrb, RSTRING_PTR(iv_name)); + iv_name_id = mrb_intern(mrb, RSTRING_PTR(iv_name), RSTRING_LEN(iv_name)); valid_iv_name(mrb, iv_name_id, RSTRING_PTR(iv_name), RSTRING_LEN(iv_name)); } else { -- cgit v1.2.3