Commit d65542cc authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #153 from carsonmcdonald/irepfix

idx should be less than the cap, if it is equal irep needs to grow.
parents 103ef78e 1685d241
......@@ -78,8 +78,8 @@ mrb_add_irep(mrb_state *mrb, int idx)
mrb->irep = mrb_malloc(mrb, sizeof(mrb_irep*)*max);
mrb->irep_capa = max;
}
else if (mrb->irep_capa < idx) {
while (mrb->irep_capa < idx) {
else if (mrb->irep_capa <= idx) {
while (mrb->irep_capa <= idx) {
mrb->irep_capa *= 2;
}
mrb->irep = mrb_realloc(mrb, mrb->irep, sizeof(mrb_irep)*mrb->irep_capa);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment