diff options
| author | Paul Eggert | 2018-10-30 20:57:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-10-30 20:58:48 -0700 |
| commit | cf486a7a920d3d95fa9aa98d7b03ebc61b17518a (patch) | |
| tree | fa50f7b87708463c36e714078012706b4cefdb23 /src/bytecode.c | |
| parent | b9cbdd045f2d086390b3d0e4412ebac0b19aaead (diff) | |
| download | emacs-cf486a7a920d3d95fa9aa98d7b03ebc61b17518a.tar.gz emacs-cf486a7a920d3d95fa9aa98d7b03ebc61b17518a.zip | |
Improve fix for Bug#33014
Although the previously-applied fix worked for its platform,
it doesn’t suffice in general.
* src/bytecode.c (exec_byte_code): Save VECTOR into stack slot
so that it survives GC. The stack slot was otherwise unused,
so this doesn’t cost us memory, only a store insn.
* src/eval.c (Ffuncall): Do not make FUN volatile, reverting
2018-10-14T19:12:04Z!gazally@runbox.com. Adding ‘volatile’
does not suffice, since storage for a volatile local can be
reclaimed after its last access (e.g., by tail recursion
elimination), which would make VECTOR invisible to GC.
Diffstat (limited to 'src/bytecode.c')
| -rw-r--r-- | src/bytecode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index 17457fc5742..40389e08f0e 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -369,6 +369,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 369 | ptrdiff_t item_bytes = stack_items * word_size; | 369 | ptrdiff_t item_bytes = stack_items * word_size; |
| 370 | Lisp_Object *stack_base = ptr_bounds_clip (alloc, item_bytes); | 370 | Lisp_Object *stack_base = ptr_bounds_clip (alloc, item_bytes); |
| 371 | Lisp_Object *top = stack_base; | 371 | Lisp_Object *top = stack_base; |
| 372 | *top = vector; /* Ensure VECTOR survives GC (Bug#33014). */ | ||
| 372 | Lisp_Object *stack_lim = stack_base + stack_items; | 373 | Lisp_Object *stack_lim = stack_base + stack_items; |
| 373 | unsigned char *bytestr_data = alloc; | 374 | unsigned char *bytestr_data = alloc; |
| 374 | bytestr_data = ptr_bounds_clip (bytestr_data + item_bytes, bytestr_length); | 375 | bytestr_data = ptr_bounds_clip (bytestr_data + item_bytes, bytestr_length); |