diff options
| author | Pip Cet | 2025-07-12 10:22:01 +0000 |
|---|---|---|
| committer | Pip Cet | 2025-07-12 10:24:11 +0000 |
| commit | fce86c7e9523b9b6c29241ae9d1dea340f0d849c (patch) | |
| tree | 9555ccd2371da2a00f572700466628b910c72013 /src | |
| parent | c6c64d6da3ea48887c95ef978095ca643480cc15 (diff) | |
| download | emacs-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.c | 6 |
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 | ||
| 160 | bool | 160 | bool |
| 161 | backtrace_p (union specbinding *pdl) | 161 | backtrace_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 | ||
| 164 | static bool | 168 | static bool |
| 165 | backtrace_thread_p (struct thread_state *tstate, union specbinding *pdl) | 169 | backtrace_thread_p (struct thread_state *tstate, union specbinding *pdl) |