1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

Fix undefined behavior in mapbacktrace

* src/eval.c (Fmapbacktrace): Don't assume that PDL is still valid.
This commit is contained in:
Philipp Stephani 2017-06-05 22:09:00 +02:00
parent 9ae5c0a2e1
commit 3d9d976aa4

View File

@ -3613,8 +3613,12 @@ returns nil. */)
while (backtrace_p (pdl))
{
ptrdiff_t i = pdl - specpdl;
backtrace_frame_apply (function, pdl);
pdl = backtrace_next (pdl);
/* Beware! PDL is no longer valid here because FUNCTION might
have caused grow_specpdl to reallocate pdlvec. We must use
the saved index, cf. Bug#27258. */
pdl = backtrace_next (&specpdl[i]);
}
return Qnil;