realloc jmpbuf if necessary

This commit is contained in:
Yuichi Nishiwaki 2014-06-29 17:24:47 +09:00
parent 3cb46b9b79
commit be2fbc394e
1 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,11 @@ pic_push_try(pic_state *pic)
{
struct pic_jmpbuf *try_jmp;
if (pic->try_jmp_idx >= pic->try_jmp_size) {
pic->try_jmp_size *= 2;
pic->try_jmps = pic_realloc(pic, pic->try_jmps, sizeof(struct pic_jmpbuf) * pic->try_jmp_size);
}
try_jmp = pic->try_jmps + pic->try_jmp_idx++;
try_jmp->ci = pic->ci;