]> code.delx.au - gnu-emacs/blobdiff - src/bytecode.c
(verify_interval_modification): Don't run
[gnu-emacs] / src / bytecode.c
index 964dca8a830b2392e1dfffc36924eb0c2ba35aaf..b142e3e667e081278a9ac42b76264891753c3b7e 100644 (file)
@@ -1,5 +1,6 @@
 /* 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.
 
@@ -39,6 +40,11 @@ by Hallvard:
 #include "charset.h"
 #include "syntax.h"
 
+#ifdef CHECK_FRAME_FONT
+#include "frame.h"
+#include "xterm.h"
+#endif
+
 /*
  * define BYTE_CODE_SAFE to enable some minor sanity checking (useful for 
  * debugging the byte compiler...)
@@ -391,6 +397,19 @@ unmark_byte_stack ()
 
 #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\
@@ -418,6 +437,16 @@ If the third argument is incorrect, Emacs may crash.")
   Lisp_Object *top;
   Lisp_Object result;
 
+#ifdef CHECK_FRAME_FONT
+ {
+   struct frame *f = SELECTED_FRAME ();
+   if (FRAME_X_P (f)
+       && FRAME_FONT (f)->direction != 0
+       && FRAME_FONT (f)->direction != 1)
+     abort ();
+ }
+#endif
+
   CHECK_STRING (bytestr, 0);
   if (!VECTORP (vector))
     vector = wrong_type_argument (Qvectorp, vector);
@@ -514,7 +543,7 @@ If the third argument is incorrect, Emacs may crash.")
          op = FETCH2;
          if (NILP (POP))
            {
-             QUIT;
+             BYTE_CODE_QUIT;
              CHECK_RANGE (op);
              stack.pc = stack.byte_string_start + op;
            }
@@ -720,7 +749,7 @@ If the third argument is incorrect, Emacs may crash.")
 
        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;
@@ -731,7 +760,7 @@ If the third argument is incorrect, Emacs may crash.")
          op = FETCH2;
          if (!NILP (POP))
            {
-             QUIT;
+             BYTE_CODE_QUIT;
              CHECK_RANGE (op);
              stack.pc = stack.byte_string_start + op;
            }
@@ -742,7 +771,7 @@ If the third argument is incorrect, Emacs may crash.")
          op = FETCH2;
          if (NILP (TOP))
            {
-             QUIT;
+             BYTE_CODE_QUIT;
              CHECK_RANGE (op);
              stack.pc = stack.byte_string_start + op;
            }
@@ -754,7 +783,7 @@ If the third argument is incorrect, Emacs may crash.")
          op = FETCH2;
          if (!NILP (TOP))
            {
-             QUIT;
+             BYTE_CODE_QUIT;
              CHECK_RANGE (op);
              stack.pc = stack.byte_string_start + op;
            }
@@ -763,7 +792,7 @@ If the third argument is incorrect, Emacs may crash.")
 
        case BRgoto:
          MAYBE_GC ();
-         QUIT;
+         BYTE_CODE_QUIT;
          stack.pc += (int) *stack.pc - 127;
          break;
 
@@ -771,7 +800,7 @@ If the third argument is incorrect, Emacs may crash.")
          MAYBE_GC ();
          if (NILP (POP))
            {
-             QUIT;
+             BYTE_CODE_QUIT;
              stack.pc += (int) *stack.pc - 128;
            }
          stack.pc++;
@@ -781,7 +810,7 @@ If the third argument is incorrect, Emacs may crash.")
          MAYBE_GC ();
          if (!NILP (POP))
            {
-             QUIT;
+             BYTE_CODE_QUIT;
              stack.pc += (int) *stack.pc - 128;
            }
          stack.pc++;
@@ -792,7 +821,7 @@ If the third argument is incorrect, Emacs may crash.")
          op = *stack.pc++;
          if (NILP (TOP))
            {
-             QUIT;
+             BYTE_CODE_QUIT;
              stack.pc += op - 128;
            }
          else DISCARD (1);
@@ -803,7 +832,7 @@ If the third argument is incorrect, Emacs may crash.")
          op = *stack.pc++;
          if (!NILP (TOP))
            {
-             QUIT;
+             BYTE_CODE_QUIT;
              stack.pc += op - 128;
            }
          else DISCARD (1);
@@ -873,6 +902,7 @@ If the third argument is incorrect, Emacs may crash.")
 
        case Btemp_output_buffer_setup:
          BEFORE_POTENTIAL_GC ();
+         CHECK_STRING (TOP, 0);
          temp_output_buffer_setup (XSTRING (TOP)->data);
          AFTER_POTENTIAL_GC ();
          TOP = Vstandard_output;
@@ -1178,8 +1208,10 @@ If the third argument is incorrect, Emacs may crash.")
        case Bgeq:
          {
            Lisp_Object v1;
+           BEFORE_POTENTIAL_GC ();
            v1 = POP;
            TOP = Fgeq (TOP, v1);
+           AFTER_POTENTIAL_GC ();
            break;
          }
 
@@ -1326,7 +1358,9 @@ If the third argument is incorrect, Emacs may crash.")
        case Bcurrent_column:
          {
            Lisp_Object v1;
+           BEFORE_POTENTIAL_GC ();
            XSETFASTINT (v1, current_column ());
+           AFTER_POTENTIAL_GC ();
            PUSH (v1);
            break;
          }