From: Paul Eggert Date: Sat, 27 Jul 2019 17:24:19 +0000 (-0700) Subject: Fix arithmetic overflow in GC consing count X-Git-Tag: emacs-27.0.90~1817^2~65 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c26469daa752baf276bcad61b042b218402547de;p=emacs.git Fix arithmetic overflow in GC consing count * src/alloc.c (allow_garbage_collection): Redo expression to avoid signed arithmetic overflow in an intermediate expression when CONSING is negative. --- diff --git a/src/alloc.c b/src/alloc.c index c17bdb719a9..5e089311a27 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5498,7 +5498,7 @@ staticpro (Lisp_Object const *varaddress) static void allow_garbage_collection (intmax_t consing) { - consing_until_gc -= OBJECT_CT_MAX - consing; + consing_until_gc = consing - (OBJECT_CT_MAX - consing_until_gc); garbage_collection_inhibited--; }