(struct buffer_text, struct buffer):
Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
Use EMACS_INT, not int, where int might not be wide enough.
- * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, to avoid
- needless 32-bit limit on 64-bit hosts. Remove unnecessary
- memory-full test. Use EMACS_INT, not ptrdiff_t or int, where
- ptrdiff_t or int might not be wide enough.
+ * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
+ not int, to avoid needless 32-bit limit on 64-bit hosts.
+ (exec_byte_code): Use tighter memory-full test, one that checks
+ for alloca overflow. Don't compute the address of the object just
+ before an array, as that's not portable. Use EMACS_INT, not
+ ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
* callint.c (Fcall_interactively):
Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
* callproc.c (call_process_kill, Fcall_process):
{
if (stack->byte_string_start != SDATA (stack->byte_string))
{
- int offset = stack->pc - stack->byte_string_start;
+ ptrdiff_t offset = stack->pc - stack->byte_string_start;
stack->byte_string_start = SDATA (stack->byte_string);
stack->pc = stack->byte_string_start + offset;
}
#ifdef BYTE_CODE_SAFE
ptrdiff_t const_length;
Lisp_Object *stacke;
- int bytestr_length;
+ ptrdiff_t bytestr_length;
#endif
struct byte_stack stack;
Lisp_Object *top;
stack.byte_string = bytestr;
stack.pc = stack.byte_string_start = SDATA (bytestr);
stack.constants = vector;
- top = (Lisp_Object *) alloca (XFASTINT (maxdepth)
+ if (MAX_ALLOCA / sizeof (Lisp_Object) <= XFASTINT (maxdepth))
+ memory_full (SIZE_MAX);
+ top = (Lisp_Object *) alloca ((XFASTINT (maxdepth) + 1)
* sizeof (Lisp_Object));
#if BYTE_MAINTAIN_TOP
- stack.bottom = top;
+ stack.bottom = top + 1;
stack.top = NULL;
#endif
- top -= 1;
stack.next = byte_stack_list;
byte_stack_list = &stack;