Fixed a memory problem in Array#to_h

Reported from Alex Snaps via Mathieu Leduc-Hamel,
both from shopify.com.  Thank you!
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-11-16 01:29:04 +09:00
parent 4f6cce059b
commit 739dad6e87
4 changed files with 21 additions and 10 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ mrb_ary_to_h(mrb_state *mrb, mrb_value ary)
if (mrb_nil_p(v)) {
mrb_raisef(mrb, E_TYPE_ERROR, "wrong element type %S at %S (expected array)",
mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, RARRAY_PTR(ary)[i])),
mrb_str_new_cstr(mrb, mrb_obj_classname(mrb, ary_elt(ary, i))),
mrb_fixnum_value(i)
);
}