]> git.eshelyaron.com Git - emacs.git/commit
Fix SAFE_ALLOCA to not exhaust the stack when in a loop.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 23 Sep 2014 05:42:47 +0000 (22:42 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 23 Sep 2014 05:42:47 +0000 (22:42 -0700)
commitcb8e2bfba7e712815203264a0c40bf2da1ff4e64
tree72b730a1653aa4987e338042b7f5297f9bcf7071
parent9949231fb06aa4a2dfa536e9d5125a81424db3a7
Fix SAFE_ALLOCA to not exhaust the stack when in a loop.

Problem reported by Dmietry Antipov in thread leading to:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00713.html
This patch fixes only SAFE_ALLOCA, SAFE_NALLOCA, and SAFE_ALLOCA_LISP;
the experimental local_* macros enabled by USE_LOCAL_ALLOCATORS
remain unfixed.
* callproc.c (call_process): Save and restore sa_avail.
* lisp.h (USE_SAFE_ALLOCA): Define sa_avail.
(AVAIL_ALLOCA): New macro.
(SAFE_ALLOCA, SAFE_NALLOCA, SAFE_ALLOCA_LISP):
Use it, and check against sa_avail rather than MAX_ALLOCA.
src/ChangeLog
src/callproc.c
src/lisp.h