Subject: Re: bug#37006: 27.0.50; garbage collection not happening after 26de2d42

From: Mattias Engdegård <[email-masked]>
Date: Sun, 11 Aug 2019 18:23:28 +0200

Observed on macOS as well. Reason: free_cons has the condition

 if (INT_ADD_WRAPV (consing_until_gc, sizeof *ptr, &consing_until_gc))

which will return true (overflow) if consing_until_gc is negative, which is kind of defensible since sizeof is unsigned which causes the sum (consing_until_gc + sizeof *ptr) to be a large unsigned number that doesn't fit into consing_until_gc.

Clang 10 defines __GNUC__ to 4 which causes intprops.h to not use __builtin_add_overflow despite that being present and working.

Casting the sizeof should fix it; patch attached.