Contents in 1999-06-04-13 of release-21-2.
[chise/xemacs-chise.git.1] / src / bytecode.c
index b5111d1..de2b646 100644 (file)
@@ -226,12 +226,6 @@ static Lisp_Object execute_optimized_program (CONST Opbyte *program,
 
 extern Lisp_Object Qand_rest, Qand_optional;
 
-/* Define ERROR_CHECK_BYTE_CODE to enable some minor sanity checking.
-   Useful for debugging the byte compiler.  */
-#ifdef DEBUG_XEMACS
-#define ERROR_CHECK_BYTE_CODE
-#endif
-
 /* Define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
    This isn't defined in FSF Emacs and isn't defined in XEmacs v19. */
 /* #define BYTE_CODE_METER */
@@ -529,7 +523,11 @@ funcall_compiled_function (Lisp_Object fun, int nargs, Lisp_Object args[])
                                 f->stack_depth,
                                 XVECTOR_DATA (f->constants));
 
-    UNBIND_TO_GCPRO_VARIABLES_ONLY (speccount, value);
+    /* The attempt to optimize this by only unbinding variables failed
+       because using buffer-local variables as function parameters
+       leads to specpdl_ptr->func != 0 */
+    /* UNBIND_TO_GCPRO_VARIABLES_ONLY (speccount, value); */
+    UNBIND_TO_GCPRO (speccount, value);
     return value;
   }
 
@@ -2336,7 +2334,7 @@ If the byte code for compiled function FUNCTION is lazy-loaded, fetch it now.
   if (OPAQUEP (f->instructions) || STRINGP (f->instructions))
     return function;
 
-  if (CONSP (XCOMPILED_FUNCTION (function)->instructions))
+  if (CONSP (f->instructions))
     {
       Lisp_Object tem = read_doc_string (f->instructions);
       if (!CONSP (tem))
@@ -2346,8 +2344,8 @@ If the byte code for compiled function FUNCTION is lazy-loaded, fetch it now.
        ebolify_bytecode_constants (XCDR (tem));
       /* VERY IMPORTANT to purecopy here!!!!!
         See load_force_doc_string_unwind. */
-      /* f->instructions = Fpurecopy (XCAR (tem)); */
-      f->constants = Fpurecopy (XCDR (tem));
+      f->instructions = Fpurecopy (XCAR (tem));
+      f->constants    = Fpurecopy (XCDR (tem));
       return function;
     }
   abort ();