]> granicus.if.org Git - gc/commit
Eliminate 'integer shift by a negative amount' code defect in finalize
authorIvan Maidanski <ivmai@mail.ru>
Fri, 16 Dec 2016 22:01:06 +0000 (01:01 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 6 Feb 2017 17:28:37 +0000 (20:28 +0300)
commitff84a50bd5d964852ad0f2e9902b57152939ebe4
tree2eabcd27c98d44eb05efc3ca7bb6429e20bf5153
parent8956311b32d20612706604ea182ef77fb6412111
Eliminate 'integer shift by a negative amount' code defect in finalize

* finalize.c (GC_register_disappearing_link_inner): Add assertion that
dl_hashtbl->log_size is non-negative after GC_grow_table() call.
* finalize.c (GC_unregister_disappearing_link_inner): If
dl_hashtbl->log_size is negative then return immediately (to avoid an
integer value shift by log_size==-1 in HASH2).
* finalize.c [!GC_MOVE_DISAPPEARING_LINK_NOT_NEEDED]
(GC_move_disappearing_link_inner): Likewise.
* finalize.c (GC_register_finalizer_inner): Add assertion that
log_fo_table_size is non-negative after GC_grow_table() call.
* finalize.c (GC_finalize): Add assertion that log_fo_table_size is
non-negative unless GC_fnlz_roots.finalize_now is null.
finalize.c