From c26469daa752baf276bcad61b042b218402547de Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 27 Jul 2019 10:24:19 -0700 Subject: [PATCH] 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. --- src/alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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--; } -- 2.39.2