summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorcubicdaiya <[email protected]>2014-02-26 13:50:51 +0900
committercubicdaiya <[email protected]>2014-02-26 17:26:40 +0900
commitd31611574835771733101fee216bc296fae052a6 (patch)
tree9417cd74721928e86a35fb3d79a1b76d04c0718e /src
parentf3e9a066aa267b3b2ed5b95cb6fbc86d68bd9187 (diff)
downloadmruby-d31611574835771733101fee216bc296fae052a6.tar.gz
mruby-d31611574835771733101fee216bc296fae052a6.zip
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)
Diffstat (limited to 'src')
-rw-r--r--src/kernel.c2
1 files changed, 1 insertions, 1 deletions
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 {