aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 8746568f166..78207f776c1 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -24,6 +24,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
24#include "character.h" 24#include "character.h"
25#include "buffer.h" 25#include "buffer.h"
26#include "keyboard.h" 26#include "keyboard.h"
27#include "ptr-bounds.h"
27#include "syntax.h" 28#include "syntax.h"
28#include "window.h" 29#include "window.h"
29 30
@@ -363,13 +364,15 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
363 unsigned char quitcounter = 1; 364 unsigned char quitcounter = 1;
364 EMACS_INT stack_items = XFASTINT (maxdepth) + 1; 365 EMACS_INT stack_items = XFASTINT (maxdepth) + 1;
365 USE_SAFE_ALLOCA; 366 USE_SAFE_ALLOCA;
366 Lisp_Object *stack_base; 367 void *alloc;
367 SAFE_ALLOCA_LISP_EXTRA (stack_base, stack_items, bytestr_length); 368 SAFE_ALLOCA_LISP_EXTRA (alloc, stack_items, bytestr_length);
368 Lisp_Object *stack_lim = stack_base + stack_items; 369 ptrdiff_t item_bytes = stack_items * word_size;
370 Lisp_Object *stack_base = ptr_bounds_clip (alloc, item_bytes);
369 Lisp_Object *top = stack_base; 371 Lisp_Object *top = stack_base;
370 memcpy (stack_lim, SDATA (bytestr), bytestr_length); 372 Lisp_Object *stack_lim = stack_base + stack_items;
371 void *void_stack_lim = stack_lim; 373 unsigned char *bytestr_data = alloc;
372 unsigned char const *bytestr_data = void_stack_lim; 374 bytestr_data = ptr_bounds_clip (bytestr_data + item_bytes, bytestr_length);
375 memcpy (bytestr_data, SDATA (bytestr), bytestr_length);
373 unsigned char const *pc = bytestr_data; 376 unsigned char const *pc = bytestr_data;
374 ptrdiff_t count = SPECPDL_INDEX (); 377 ptrdiff_t count = SPECPDL_INDEX ();
375 378