]> git.eshelyaron.com Git - emacs.git/commitdiff
add assertion to flush_stack_call_func
authorTom Tromey <tromey@redhat.com>
Sat, 6 Jul 2013 20:31:16 +0000 (14:31 -0600)
committerTom Tromey <tromey@redhat.com>
Sat, 6 Jul 2013 20:31:16 +0000 (14:31 -0600)
functions called via flush_stack_call_func are assumed
to return with the global lock held again, and with
current_thread reset.  this assertion verifies part of this

src/alloc.c

index b5885bdb283013e29787ef9cffb2aaa1023bb0e1..d62b671d4400da3e46cbf7e7ad726be42f164f21 100644 (file)
@@ -4649,6 +4649,7 @@ void
 flush_stack_call_func (void (*func) (void *arg), void *arg)
 {
   void *end;
+  struct thread_state *self = current_thread;
 
 #ifdef HAVE___BUILTIN_UNWIND_INIT
   /* Force callee-saved registers and register windows onto the stack.
@@ -4702,8 +4703,10 @@ flush_stack_call_func (void (*func) (void *arg), void *arg)
 #endif /* not GC_SAVE_REGISTERS_ON_STACK */
 #endif /* not HAVE___BUILTIN_UNWIND_INIT */
 
-  current_thread->stack_top = end;
+  self->stack_top = end;
   (*func) (arg);
+
+  eassert (current_thread == self);
 }
 
 #endif /* GC_MARK_STACK != 0 */