changeset 48909:ac6f6d4b84ec

Errors and throws work right with interrupt blocking. (struct catchtag): New elt interrupt_input_blocked. (unwind_to_catch): Restore interrupt_input_blocked from saved value. (internal_catch, Fcondition_case, internal_condition_case) (internal_condition_case_1, internal_condition_case_2): Save it. (Fsignal): Don't do TOTALLY_UNBLOCK_INPUT.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Dec 2002 18:05:00 +0000
parents d5680dc3113e
children f1010d7b4fd9
files src/eval.c
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Sat Dec 21 18:00:23 2002 +0000
+++ b/src/eval.c	Sat Dec 21 18:05:00 2002 +0000
@@ -77,6 +77,7 @@
   int lisp_eval_depth;
   int pdlcount;
   int poll_suppress_count;
+  int interrupt_input_blocked;
   struct byte_stack *byte_stack;
 };
 
@@ -1103,6 +1104,7 @@
   c.lisp_eval_depth = lisp_eval_depth;
   c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
+  c.interrupt_input_blocked = interrupt_input_blocked;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
   catchlist = &c;
@@ -1144,6 +1146,7 @@
 
   /* Restore the polling-suppression count.  */
   set_poll_suppress_count (catch->poll_suppress_count);
+  interrupt_input_blocked = catch->interrupt_input_blocked;
 
   do
     {
@@ -1270,6 +1273,7 @@
   c.lisp_eval_depth = lisp_eval_depth;
   c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
+  c.interrupt_input_blocked = interrupt_input_blocked;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
   if (_setjmp (c.jmp))
@@ -1319,12 +1323,8 @@
   struct catchtag c;
   struct handler h;
 
-#if 0 /* Can't do this check anymore because realize_basic_faces has
-	 to BLOCK_INPUT, and can call Lisp.  What's really needed is a
-	 flag indicating that we're currently handling a signal.  */
-  /* Since Fsignal resets this to 0, it had better be 0 now
-     or else we have a potential bug.  */
-  if (interrupt_input_blocked != 0)
+#if 0 /* We now handle interrupt_input_blocked properly.
+	 What we still do not handle is exiting a signal handler.  */
     abort ();
 #endif
 
@@ -1335,6 +1335,7 @@
   c.lisp_eval_depth = lisp_eval_depth;
   c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
+  c.interrupt_input_blocked = interrupt_input_blocked;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
   if (_setjmp (c.jmp))
@@ -1355,7 +1356,7 @@
   return val;
 }
 
-/* Like internal_condition_case but call HFUN with ARG as its argument.  */
+/* Like internal_condition_case but call BFUN with ARG as its argument.  */
 
 Lisp_Object
 internal_condition_case_1 (bfun, arg, handlers, hfun)
@@ -1375,6 +1376,7 @@
   c.lisp_eval_depth = lisp_eval_depth;
   c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
+  c.interrupt_input_blocked = interrupt_input_blocked;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
   if (_setjmp (c.jmp))
@@ -1396,7 +1398,7 @@
 }
 
 
-/* Like internal_condition_case but call HFUN with NARGS as first,
+/* Like internal_condition_case but call BFUN with NARGS as first,
    and ARGS as second argument.  */
 
 Lisp_Object
@@ -1418,6 +1420,7 @@
   c.lisp_eval_depth = lisp_eval_depth;
   c.pdlcount = SPECPDL_INDEX ();
   c.poll_suppress_count = poll_suppress_count;
+  c.interrupt_input_blocked = interrupt_input_blocked;
   c.gcpro = gcprolist;
   c.byte_stack = byte_stack_list;
   if (_setjmp (c.jmp))
@@ -1474,8 +1477,6 @@
   if (gc_in_progress || waiting_for_input)
     abort ();
 
-  TOTALLY_UNBLOCK_INPUT;
-
   if (NILP (error_symbol))
     real_error_symbol = Fcar (data);
   else