diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-01-06 14:53:00 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-01-06 14:53:00 +0900 |
| commit | 885d929398cf6962f3b0d292cf44105976f6c848 (patch) | |
| tree | 8b4c9748b619f4ca2f646af5b3f12b7827727b95 /src/array.c | |
| parent | c6a11725923090278bb4941579751650d9aaebce (diff) | |
| download | mruby-885d929398cf6962f3b0d292cf44105976f6c848.tar.gz mruby-885d929398cf6962f3b0d292cf44105976f6c848.zip | |
Improve capacity enhancing conditions
Diffstat (limited to 'src/array.c')
| -rw-r--r-- | src/array.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/array.c b/src/array.c index 54ff26721..420907866 100644 --- a/src/array.c +++ b/src/array.c @@ -182,10 +182,10 @@ ary_expand_capa(mrb_state *mrb, struct RArray *a, size_t len) capa *= 2; } else { - goto size_error; + capa = len; } } - if (capa < len || capa > MRB_INT_MAX) { + if (capa < len || capa > ARY_MAX_SIZE) { goto size_error; } |
