From be2fbc394e928f7b6281cb56f76ed9514d736751 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 29 Jun 2014 17:24:47 +0900 Subject: [PATCH] realloc jmpbuf if necessary --- src/error.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/error.c b/src/error.c index 517677b4..369fb185 100644 --- a/src/error.c +++ b/src/error.c @@ -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;