Commit 1685d241 authored by Carson McDonald's avatar Carson McDonald

idx should be less than the cap, if it is equal irep needs to grow.

parent 103ef78e
......@@ -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