1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Avoid crashes when profiling multi-threaded Lisp (bug#76970)

* src/eval.c (backtrace_p): Check 'current_thread' before
dereferencing it.
This commit is contained in:
Pip Cet 2025-07-12 10:22:01 +00:00
parent c6c64d6da3
commit fce86c7e95

View file

@ -159,7 +159,11 @@ set_backtrace_debug_on_exit (union specbinding *pdl, bool doe)
bool bool
backtrace_p (union specbinding *pdl) backtrace_p (union specbinding *pdl)
{ return specpdl ? pdl >= specpdl : false; } {
if (current_thread && specpdl && pdl)
return pdl >= specpdl;
return false;
}
static bool static bool
backtrace_thread_p (struct thread_state *tstate, union specbinding *pdl) backtrace_thread_p (struct thread_state *tstate, union specbinding *pdl)