icecc / icecream

Distributed compiler with a central scheduler to share build load
GNU General Public License v2.0
1.58k stars 248 forks source link

avoid integer overflow for cache-limit #620

Open michaelolbrich opened 1 year ago

michaelolbrich commented 1 year ago

Without this, "mb 1024 1024" overflows for mb >= 2048. The result is then cast into size_t, which is unsigned and usually a 64-bit integer. The end result is, that the cache is now basically unlimited.

Fix this by making mb a size_t as well to avoid the overflow.