emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 94644d8: Fix garbage collection


From: Eli Zaretskii
Subject: [Emacs-diffs] master 94644d8: Fix garbage collection
Date: Sun, 11 Aug 2019 12:24:54 -0400 (EDT)

branch: master
commit 94644d862c9a54a5ebe8265fbba04bdd0c973065
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix garbage collection
    
    * src/alloc.c (free_cons): Avoid false positives in
    INT_ADD_WRAPV.  (Bug#37006)
---
 src/alloc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/alloc.c b/src/alloc.c
index 5e08931..d9022ac 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2542,7 +2542,9 @@ free_cons (struct Lisp_Cons *ptr)
   ptr->u.s.u.chain = cons_free_list;
   ptr->u.s.car = dead_object ();
   cons_free_list = ptr;
-  if (INT_ADD_WRAPV (consing_until_gc, sizeof *ptr, &consing_until_gc))
+  if (consing_until_gc <= 0)
+    consing_until_gc += sizeof *ptr;
+  else if (INT_ADD_WRAPV (consing_until_gc, sizeof *ptr, &consing_until_gc))
     consing_until_gc = OBJECT_CT_MAX;
   gcstat.total_free_conses++;
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]