aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPip Cet2025-07-12 10:22:01 +0000
committerPip Cet2025-07-12 10:24:11 +0000
commitfce86c7e9523b9b6c29241ae9d1dea340f0d849c (patch)
tree9555ccd2371da2a00f572700466628b910c72013 /src
parentc6c64d6da3ea48887c95ef978095ca643480cc15 (diff)
downloademacs-fce86c7e9523b9b6c29241ae9d1dea340f0d849c.tar.gz
emacs-fce86c7e9523b9b6c29241ae9d1dea340f0d849c.zip
Avoid crashes when profiling multi-threaded Lisp (bug#76970)
* src/eval.c (backtrace_p): Check 'current_thread' before dereferencing it.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 4c514001d9d..5e2b5bff796 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -159,7 +159,11 @@ set_backtrace_debug_on_exit (union specbinding *pdl, bool doe)
159 159
160bool 160bool
161backtrace_p (union specbinding *pdl) 161backtrace_p (union specbinding *pdl)
162{ return specpdl ? pdl >= specpdl : false; } 162{
163 if (current_thread && specpdl && pdl)
164 return pdl >= specpdl;
165 return false;
166}
163 167
164static bool 168static bool
165backtrace_thread_p (struct thread_state *tstate, union specbinding *pdl) 169backtrace_thread_p (struct thread_state *tstate, union specbinding *pdl)