diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-20 06:00:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-20 06:00:51 +0000 |
commit | 36f984b65eaa2f78130cb6435c6498fa727dd0cf (patch) | |
tree | 1d7ec5acd4a5aef8d5d3a6e128a6ac93485f90c2 | |
parent | 9ddb37f071688be901c8e0b4e914d15313cdc900 (diff) |
* compile.c (iseq_set_exception_table): allocates catch_table only
when entries exist.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | compile.c | 2 |
2 files changed, 5 insertions, 2 deletions
@@ -1,4 +1,7 @@ -Sun Apr 20 14:58:57 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> +Sun Apr 20 15:00:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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. @@ -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++) { |