]> granicus.if.org Git - gc/commit
Fix '32-bit value shift followed by expansion to 64-bit' code defect
authorIvan Maidanski <ivmai@mail.ru>
Wed, 7 Dec 2016 07:22:09 +0000 (10:22 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 7 Dec 2016 07:22:09 +0000 (10:22 +0300)
commit18985f65b411b9fee8f69f6608f07de7f27ee6c9
tree23e36f42017e47c33596dc88087d494d6ae0809e
parent8d43b72f2a690c77bdb376c461ee1c6360710745
Fix '32-bit value shift followed by expansion to 64-bit' code defect

* gcj_mlc.c [GC_GCJ_SUPPORT] (GC_core_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Cast lg local variable to word before
passing it to GRANULES_TO_BYTES (so that value type widening does not
occur after the value left shift).
* malloc.c (GC_generic_malloc_inner, GC_malloc_kind_global,
GC_generic_malloc_uncollectable): Likewise.
* typd_mlc.c (GC_malloc_explicitly_typed_ignore_off_page): Likewise.
* misc.c (block_add_size): Cast hhdr->hb_sz to word before passing it
to WORDS_TO_BYTES; cast HBLKSIZE-1 to word before "~" operation.
gcj_mlc.c
malloc.c
misc.c
typd_mlc.c