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)
This commit is contained in:
cubicdaiya
2014-02-26 13:50:51 +09:00
parent f3e9a066aa
commit d316115748
+1 -1
View File
@@ -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 {