* src/eval.c (record_in_backtrace): Use 'backtrace_top' instead of
'backtrace_next', and check that 'backtrace_byte_offset' > 0 before
calling it, so the specbinding stack isn't scanned just to store an
invalid offset.
specpdl_ptr->bt.function = function;
current_thread->stack_top = specpdl_ptr->bt.args = args;
specpdl_ptr->bt.nargs = nargs;
- union specbinding *nxt = specpdl_ptr;
- nxt = backtrace_next(nxt);
- if (nxt->kind == SPECPDL_BACKTRACE)
- nxt->bt.bytecode_offset = backtrace_byte_offset;
+ if (backtrace_byte_offset > 0) {
+ union specbinding *nxt = backtrace_top ();
+ if (backtrace_p (nxt) && nxt->kind == SPECPDL_BACKTRACE)
+ nxt->bt.bytecode_offset = backtrace_byte_offset;
+ }
grow_specpdl ();
return count;