Skip to content

Commit

Permalink
Fix compile error by #3309
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Dec 1, 2016
1 parent 61ac564 commit ab4ab7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ mrb_ary_s_create(mrb_state *mrb, mrb_value self)
static void
ary_concat(mrb_state *mrb, struct RArray *a, struct RArray *a2)
{
mrb_int len;

if (a2->len > ARY_MAX_SIZE - a->len) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big");
}
mrb_int len = a->len + a2->len;
len = a->len + a2->len;

ary_modify(mrb, a);
if (a->aux.capa < len) {
Expand Down

0 comments on commit ab4ab7c

Please sign in to comment.