From: Eli Zaretskii Date: Sun, 11 Aug 2019 16:23:23 +0000 (+0300) Subject: Fix garbage collection X-Git-Tag: emacs-27.0.90~1645 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=94644d862c9a54a5ebe8265fbba04bdd0c973065;p=emacs.git Fix garbage collection * src/alloc.c (free_cons): Avoid false positives in INT_ADD_WRAPV. (Bug#37006) --- diff --git a/src/alloc.c b/src/alloc.c index 5e089311a27..d9022ac46c3 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++; }