* throw.c (scm_ithrow): Abort when scm_i_critical_section_level is
authorMarius Vollmer <mvo@zagadka.de>
Mon, 7 Mar 2005 21:40:19 +0000 (21:40 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Mon, 7 Mar 2005 21:40:19 +0000 (21:40 +0000)
not zero.

libguile/throw.c

index 8547fb2..ed1dbd8 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include "libguile/_scm.h"
+#include "libguile/async.h"
 #include "libguile/smob.h"
 #include "libguile/alist.h"
 #include "libguile/eval.h"
@@ -586,6 +587,12 @@ scm_ithrow (SCM key, SCM args, int noreturn SCM_UNUSED)
   SCM dynpair = SCM_UNDEFINED;
   SCM winds;
 
+  if (scm_i_critical_section_level)
+    {
+      fprintf (stderr, "throw from within critical section.\n");
+      abort ();
+    }
+
   /* Search the wind list for an appropriate catch.
      "Waiter, please bring us the wind list." */
   for (winds = scm_i_dynwinds (); scm_is_pair (winds); winds = SCM_CDR (winds))