diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-16 01:29:04 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-16 01:29:04 +0900 |
| commit | 739dad6e87e91c74cda794ae3f33cd94a7c33eb1 (patch) | |
| tree | 04efbd14bcc5463fc2a8f7975f2ef9623715f954 /mrbgems/mruby-array-ext/src | |
| parent | 4f6cce059b317f7e6c1da801fe0edd487985df6e (diff) | |
| download | mruby-739dad6e87e91c74cda794ae3f33cd94a7c33eb1.tar.gz mruby-739dad6e87e91c74cda794ae3f33cd94a7c33eb1.zip | |
Fixed a memory problem in Array#to_h
Reported from Alex Snaps via Mathieu Leduc-Hamel,
both from shopify.com. Thank you!
Diffstat (limited to 'mrbgems/mruby-array-ext/src')
| -rw-r--r-- | mrbgems/mruby-array-ext/src/array.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-array-ext/src/array.c b/mrbgems/mruby-array-ext/src/array.c index d5c96e2cc..af947303b 100644 --- a/mrbgems/mruby-array-ext/src/array.c +++ b/mrbgems/mruby-array-ext/src/array.c @@ -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) ); } |
