Commit 8944310
committed
Don't signal during backtrace unrewind (Bug#40088)
backtrace_eval_unrewind is used to temporarily reverse
let-bindings (it's called with a positive argument to reverse
bindings, and then a negative argument to re-apply them) by
backtrace--locals and backtrace-eval. For the SPECPDL_LET_DEFAULT and
SPECPDL_LET_LOCAL cases (which occur for let-bindings on buffer-local
variables), the code calls Fdefault_value and Fbuffer_local_value on
the symbol.
For symbols which are unbound at top-level, the first (with positive
argument) call to backtrace_eval_unrewind will set the symbol's value
to unbound (putting the current value in the specpdl's "old value"
slot). On the second (with negative argument) call,
backtrace_eval_unrewind attempts to retrieve the symbol's value with
Fdefault_value or Fbuffer_local_value, but that raises a void-variable
signal. This interrupts the restoration of the let-bindings, so any
other variables more recent on the stack will now have the wrong
value.
* src/data.c (default_value): Make non-static.
* src/lisp.h: Declare it.
* src/eval.c (backtrace_eval_unrewind): Replace the calls to
Fdefault_value and Fbuffer_local_value with default_value and
buffer_local_value, respectively. The latter do exactly the same as
the former, except if the symbol's value is Qunbound they just return
it instead of signaling void-variable.1 parent 8709aad commit 8944310
3 files changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1573 | 1573 | | |
1574 | 1574 | | |
1575 | 1575 | | |
1576 | | - | |
| 1576 | + | |
1577 | 1577 | | |
1578 | 1578 | | |
1579 | 1579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3816 | 3816 | | |
3817 | 3817 | | |
3818 | 3818 | | |
3819 | | - | |
| 3819 | + | |
3820 | 3820 | | |
3821 | 3821 | | |
3822 | 3822 | | |
| |||
3832 | 3832 | | |
3833 | 3833 | | |
3834 | 3834 | | |
3835 | | - | |
| 3835 | + | |
3836 | 3836 | | |
3837 | 3837 | | |
3838 | 3838 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
| 597 | + | |
597 | 598 | | |
598 | 599 | | |
599 | 600 | | |
| |||
0 commit comments