]> granicus.if.org Git - gc/commit
Fix GC_collect_or_expand to prevent allocation size value wrap-around
authorIvan Maidanski <ivmai@mail.ru>
Tue, 27 Sep 2016 07:12:18 +0000 (10:12 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 10 Nov 2016 07:27:23 +0000 (10:27 +0300)
commit1f3c938e5482e3770df2163ab03ed760fd12155a
tree8b35c181b15f1939aa62a608ba133d2678a6b84f
parent0b6818708f7644db5c7bd0cc80e7adaa5a889257
Fix GC_collect_or_expand to prevent allocation size value wrap-around

Relates to issue #135 on Github.

* alloc.c (GC_WORD_MAX): New macro.
* alloc.c (GC_collect_or_expand): Limit blocks_to_get by
GC_WORD_MAX / HBLKSIZE value (to avoid multiplication overflow in
GC_expand_hp_inner).
alloc.c