emacs-diffs
[Top][All Lists]
Advanced

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

scratch/no-purespace 9f0de5cb87b 2/2: Avoid compiler warning in process_


From: Pip Cet
Subject: scratch/no-purespace 9f0de5cb87b 2/2: Avoid compiler warning in process_mark_stack
Date: Thu, 22 Aug 2024 02:11:07 -0400 (EDT)

branch: scratch/no-purespace
commit 9f0de5cb87ba3e9b6e1be8a22ccf841ac878405a
Author: Pip Cet <pipcet@protonmail.com>
Commit: Pip Cet <pipcet@protonmail.com>

    Avoid compiler warning in process_mark_stack
    
    Problem reported by: Stefan Kangas <stefankangas@gmail.com>
    
    * src/alloc.c (process_mark_stack): Only declare and assign to 'po' if
    it's needed.
---
 src/alloc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index 974fb14115f..00fecf59fa5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6703,8 +6703,6 @@ process_mark_stack (ptrdiff_t base_sp)
     {
       Lisp_Object obj = mark_stack_pop ();
     mark_obj: ;
-      void *po = XPNTR (obj);
-
 #if GC_REMEMBER_LAST_MARKED
       last_marked[last_marked_index++] = obj;
       last_marked_index &= LAST_MARKED_SIZE - 1;
@@ -6714,6 +6712,7 @@ process_mark_stack (ptrdiff_t base_sp)
         we encounter an object we know is bogus.  This increases GC time
         by ~80%.  */
 #if GC_CHECK_MARKED_OBJECTS
+      void *po = XPNTR (obj);
 
       /* Check that the object pointed to by PO is known to be a Lisp
         structure allocated from the heap.  */
@@ -6950,7 +6949,10 @@ process_mark_stack (ptrdiff_t base_sp)
            set_string_marked (XSTRING (ptr->u.s.name));
            mark_interval_tree (string_intervals (ptr->u.s.name));
            /* Inner loop to mark next symbol in this bucket, if any.  */
-           po = ptr = ptr->u.s.next;
+           ptr = ptr->u.s.next;
+#if GC_CHECK_MARKED_OBJECTS
+           po = ptr;
+#endif
            if (ptr)
              goto nextsym;
          }



reply via email to

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