summaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-20 06:00:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-20 06:00:51 +0000
commit39c2bef13b5208314e1b134c2a8f51ddeb7a77fc (patch)
tree1d7ec5acd4a5aef8d5d3a6e128a6ac93485f90c2 /compile.c
parenta2192f17e787194221637bfffa4b3c88f08a1022 (diff)
downloadruby-39c2bef13b5208314e1b134c2a8f51ddeb7a77fc.tar.gz
ruby-39c2bef13b5208314e1b134c2a8f51ddeb7a77fc.tar.xz
ruby-39c2bef13b5208314e1b134c2a8f51ddeb7a77fc.zip
* compile.c (iseq_set_exception_table): allocates catch_table only
when entries exist. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 9571e9828..0853863fe 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++) {