]> code.delx.au - gnu-emacs/blobdiff - src/bytecode.c
Move fix for cygw32 icon issue from emacs-24 branch to trunk as Stefan Monnier requests
[gnu-emacs] / src / bytecode.c
index 5ac8b4fa2bde1314e24b358b0439eeddc6036ec7..4c5ac151de1a904c3176b70bbee35def8c103413 100644 (file)
@@ -33,7 +33,7 @@ by Hallvard:
  */
 
 #include <config.h>
-#include <setjmp.h>
+
 #include "lisp.h"
 #include "character.h"
 #include "buffer.h"
@@ -87,8 +87,6 @@ Lisp_Object Qbyte_code_meter;
 #endif /* BYTE_CODE_METER */
 \f
 
-Lisp_Object Qbytecode;
-
 /*  Byte codes: */
 
 #define BYTE_CODES                                                     \
@@ -435,7 +433,7 @@ unmark_byte_stack (void)
 #ifdef BYTE_CODE_SAFE
 
 #define CHECK_RANGE(ARG) \
-  if (ARG >= bytestr_length) abort ()
+  if (ARG >= bytestr_length) emacs_abort ()
 
 #else /* not BYTE_CODE_SAFE */
 
@@ -458,7 +456,8 @@ unmark_byte_stack (void)
        Fsignal (Qquit, Qnil);                          \
        AFTER_POTENTIAL_GC ();                          \
       }                                                        \
-    ELSE_PENDING_SIGNALS                               \
+    else if (pending_signals)                          \
+      process_pending_signals ();                      \
   } while (0)
 
 
@@ -508,7 +507,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
    if (FRAME_X_P (f)
        && FRAME_FONT (f)->direction != 0
        && FRAME_FONT (f)->direction != 1)
-     abort ();
+     emacs_abort ();
  }
 #endif
 
@@ -553,7 +552,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
   if (INTEGERP (args_template))
     {
       ptrdiff_t at = XINT (args_template);
-      int rest = at & 128;
+      bool rest = (at & 128) != 0;
       int mandatory = at & 127;
       ptrdiff_t nonrest = at >> 8;
       eassert (mandatory <= nonrest);
@@ -600,9 +599,9 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
     {
 #ifdef BYTE_CODE_SAFE
       if (top > stacke)
-       abort ();
+       emacs_abort ();
       else if (top < stack.bottom - 1)
-       abort ();
+       emacs_abort ();
 #endif
 
 #ifdef BYTE_CODE_METER
@@ -1051,7 +1050,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 
        CASE (Bsave_current_buffer): /* Obsolete since ??.  */
        CASE (Bsave_current_buffer_1):
-         record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
+         record_unwind_current_buffer ();
          NEXT;
 
        CASE (Bsave_window_excursion): /* Obsolete since 24.1.  */
@@ -1578,7 +1577,9 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
          NEXT;
 
        CASE (Binteractive_p):  /* Obsolete since 24.1.  */
-         PUSH (Finteractive_p ());
+         BEFORE_POTENTIAL_GC ();
+         PUSH (call0 (intern ("interactive-p")));
+         AFTER_POTENTIAL_GC ();
          NEXT;
 
        CASE (Bforward_char):
@@ -1875,7 +1876,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
          /* Actually this is Bstack_ref with offset 0, but we use Bdup
             for that instead.  */
          /* CASE (Bstack_ref): */
-         abort ();
+         error ("Invalid byte opcode");
 
          /* Handy byte-codes for lexical binding.  */
        CASE (Bstack_ref1):
@@ -1928,11 +1929,11 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 #ifdef BYTE_CODE_SAFE
          if (op < Bconstant)
            {
-             abort ();
+             emacs_abort ();
            }
          if ((op -= Bconstant) >= const_length)
            {
-             abort ();
+             emacs_abort ();
            }
          PUSH (vectorp[op]);
 #else
@@ -1951,7 +1952,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 #ifdef BYTE_CODE_SAFE
     error ("binding stack not balanced (serious byte compiler bug)");
 #else
-    abort ();
+    emacs_abort ();
 #endif
 
   return result;
@@ -1960,8 +1961,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 void
 syms_of_bytecode (void)
 {
-  DEFSYM (Qbytecode, "byte-code");
-
   defsubr (&Sbyte_code);
 
 #ifdef BYTE_CODE_METER