diff --git a/ChangeLog b/ChangeLog index 8661cba30b..70aa279fbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -Sun Apr 20 14:58:57 2008 Nobuyoshi Nakada +Sun Apr 20 15:00:48 2008 Nobuyoshi Nakada + + * compile.c (iseq_set_exception_table): allocates catch_table only + when entries exist. * compile.c (struct iseq_link_element, struct iseq_insn_data): made enum for debuggers. diff --git a/compile.c b/compile.c index 9571e98282..0853863feb 100644 --- a/compile.c +++ b/compile.c @@ -1290,7 +1290,7 @@ iseq_set_exception_table(rb_iseq_t *iseq) tlen = RARRAY_LEN(iseq->compile_data->catch_table_ary); tptr = RARRAY_PTR(iseq->compile_data->catch_table_ary); - iseq->catch_table = ALLOC_N(struct iseq_catch_table_entry, tlen); + iseq->catch_table = tlen ? ALLOC_N(struct iseq_catch_table_entry, tlen) : 0; iseq->catch_table_size = tlen; for (i = 0; i < tlen; i++) {