diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 13:22:21 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-20 13:22:21 +0000 |
commit | a90f3bcb0c230bfdc050d8326db4974715ea01fe (patch) | |
tree | e757efac7cee089c337aa3be7c894f222bc22aa9 /compile.c | |
parent | c9116c68f404457d23be77ab7c57bb1ffb269e2e (diff) |
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
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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<RARRAY_LEN(locals); i++) { |