From a90f3bcb0c230bfdc050d8326db4974715ea01fe Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 20 Dec 2010 13:22:21 +0000 Subject: merges r29799 from trunk into ruby_1_9_2. -- * compile.c (iseq_set_exception_local_table, iseq_set_local_table, rb_iseq_build_from_ary): fix type inconsistency (which is benign because sizeof(ID) == sizeof(ID*), though). Coverity Scan found these bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ compile.c | 8 ++++---- version.h | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d1098df35..330418cf2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Nov 15 23:41:21 2010 Yusuke Endoh + + * compile.c (iseq_set_exception_local_table, iseq_set_local_table, + rb_iseq_build_from_ary): fix type inconsistency (which is benign + because sizeof(ID) == sizeof(ID*), though). Coverity Scan found + these bugs. + Mon Nov 15 22:47:27 2010 Yusuke Endoh * vm_eval.c (rb_funcall): ensure va_end after va_init_list. Coverity diff --git a/compile.c b/compile.c index 93a6c34b71..1f27174689 100644 --- a/compile.c +++ b/compile.c @@ -985,7 +985,7 @@ iseq_set_exception_local_table(rb_iseq_t *iseq) ID id_dollar_bang; CONST_ID(id_dollar_bang, "#$!"); - iseq->local_table = (ID *)ALLOC_N(ID *, 1); + iseq->local_table = (ID *)ALLOC_N(ID, 1); iseq->local_table_size = 1; iseq->local_size = iseq->local_table_size + 1; iseq->local_table[0] = id_dollar_bang; @@ -1204,8 +1204,8 @@ iseq_set_local_table(rb_iseq_t *iseq, ID *tbl) } if (size > 0) { - iseq->local_table = (ID *)ALLOC_N(ID *, size); - MEMCPY(iseq->local_table, tbl, ID *, size); + iseq->local_table = (ID *)ALLOC_N(ID, size); + MEMCPY(iseq->local_table, tbl, ID, size); } iseq->local_size = iseq->local_table_size = size; @@ -5374,7 +5374,7 @@ rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args, INIT_ANCHOR(anchor); iseq->local_table_size = RARRAY_LENINT(locals); - iseq->local_table = tbl = (ID *)ALLOC_N(ID *, iseq->local_table_size); + iseq->local_table = tbl = (ID *)ALLOC_N(ID, iseq->local_table_size); iseq->local_size = iseq->local_table_size + 1; for (i=0; i