summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@day>2019-07-27 10:24:19 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-07-27 10:24:45 -0700
commitc26469daa752baf276bcad61b042b218402547de (patch)
treed4f457c7de12e3b1138761c8c6006448829545a1
parenta50271e0c39bad630b433e31434ef20f584bfc09 (diff)
downloademacs-c26469daa752baf276bcad61b042b218402547de.tar.gz
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.
-rw-r--r--src/alloc.c2
1 files changed, 1 insertions, 1 deletions
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--;
}