/* Execution of byte code produced by bytecomp.el.
- Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
#endif /* not BYTE_CODE_SAFE */
+/* A version of the QUIT macro which makes sure that the stack top is
+ set before signaling `quit'. */
+
+#define BYTE_CODE_QUIT \
+ do { \
+ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
+ { \
+ Vquit_flag = Qnil; \
+ BEFORE_POTENTIAL_GC (); \
+ Fsignal (Qquit, Qnil); \
+ } \
+ } while (0)
+
DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0,
"Function used internally in byte-compiled code.\n\
op = FETCH2;
if (NILP (POP))
{
- QUIT;
+ BYTE_CODE_QUIT;
CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
}
case Bgoto:
MAYBE_GC ();
- QUIT;
+ BYTE_CODE_QUIT;
op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */
CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
op = FETCH2;
if (!NILP (POP))
{
- QUIT;
+ BYTE_CODE_QUIT;
CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
}
op = FETCH2;
if (NILP (TOP))
{
- QUIT;
+ BYTE_CODE_QUIT;
CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
}
op = FETCH2;
if (!NILP (TOP))
{
- QUIT;
+ BYTE_CODE_QUIT;
CHECK_RANGE (op);
stack.pc = stack.byte_string_start + op;
}
case BRgoto:
MAYBE_GC ();
- QUIT;
+ BYTE_CODE_QUIT;
stack.pc += (int) *stack.pc - 127;
break;
MAYBE_GC ();
if (NILP (POP))
{
- QUIT;
+ BYTE_CODE_QUIT;
stack.pc += (int) *stack.pc - 128;
}
stack.pc++;
MAYBE_GC ();
if (!NILP (POP))
{
- QUIT;
+ BYTE_CODE_QUIT;
stack.pc += (int) *stack.pc - 128;
}
stack.pc++;
op = *stack.pc++;
if (NILP (TOP))
{
- QUIT;
+ BYTE_CODE_QUIT;
stack.pc += op - 128;
}
else DISCARD (1);
op = *stack.pc++;
if (!NILP (TOP))
{
- QUIT;
+ BYTE_CODE_QUIT;
stack.pc += op - 128;
}
else DISCARD (1);