summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
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++) {