aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2019-07-27 10:24:19 -0700
committerPaul Eggert2019-07-27 10:24:45 -0700
commitc26469daa752baf276bcad61b042b218402547de (patch)
treed4f457c7de12e3b1138761c8c6006448829545a1 /src/alloc.c
parenta50271e0c39bad630b433e31434ef20f584bfc09 (diff)
downloademacs-c26469daa752baf276bcad61b042b218402547de.tar.gz
emacs-c26469daa752baf276bcad61b042b218402547de.zip
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.
Diffstat (limited to 'src/alloc.c')
-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)
5498static void 5498static void
5499allow_garbage_collection (intmax_t consing) 5499allow_garbage_collection (intmax_t consing)
5500{ 5500{
5501 consing_until_gc -= OBJECT_CT_MAX - consing; 5501 consing_until_gc = consing - (OBJECT_CT_MAX - consing_until_gc);
5502 garbage_collection_inhibited--; 5502 garbage_collection_inhibited--;
5503} 5503}
5504 5504