Permalink
Browse files

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

  • Loading branch information...
carsonmcdonald committed May 17, 2012
1 parent 103ef78 commit 1685d241c4cbdcc29ca82c0c1222652b5d8395ec
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/state.c
View
@@ -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);

0 comments on commit 1685d24

Please sign in to comment.