aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGemini Lasswell2018-10-14 12:12:04 -0700
committerGemini Lasswell2018-10-29 11:05:00 -0700
commit0e484c66fd63877230c3dfa97f2ce9dda71ad88b (patch)
treea7cf3670fdd67ce433329744c4e73f3b9214cd39 /src
parentb9c60200259a562f4762e8debf4646319d7a9332 (diff)
downloademacs-0e484c66fd63877230c3dfa97f2ce9dda71ad88b.tar.gz
emacs-0e484c66fd63877230c3dfa97f2ce9dda71ad88b.zip
Keep a stack reference to bytecode objects being executed (Bug#33014)
* src/eval.c (Ffuncall): Make local variable 'fun' volatile. * test/src/eval-tests.el (eval-tests-byte-code-being-evaluated-is-protected-from-gc): Add regression test for Bug#33014. (eval-tests-33014-var): New variable. (eval-tests-33014-func, eval-tests-33014-redefine): New functions.
Diffstat (limited to 'src')
-rw-r--r--src/eval.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c
index a51d0c90831..32cfda24d8c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2820,8 +2820,11 @@ Thus, (funcall \\='cons \\='x \\='y) returns (x . y).
2820usage: (funcall FUNCTION &rest ARGUMENTS) */) 2820usage: (funcall FUNCTION &rest ARGUMENTS) */)
2821 (ptrdiff_t nargs, Lisp_Object *args) 2821 (ptrdiff_t nargs, Lisp_Object *args)
2822{ 2822{
2823 Lisp_Object fun, original_fun; 2823 /* Use 'volatile' here to cause optimizing compilers to keep a
2824 Lisp_Object funcar; 2824 reference on the stack to the function's bytecode object. See
2825 Bug#33014. */
2826 Lisp_Object volatile fun;
2827 Lisp_Object original_fun, funcar;
2825 ptrdiff_t numargs = nargs - 1; 2828 ptrdiff_t numargs = nargs - 1;
2826 Lisp_Object val; 2829 Lisp_Object val;
2827 ptrdiff_t count; 2830 ptrdiff_t count;