[uim-commit] r1840 - branches/r5rs/sigscheme

ekato at freedesktop.org ekato at freedesktop.org
Sat Oct 15 08:05:07 PDT 2005


Author: ekato
Date: 2005-10-15 08:05:03 -0700 (Sat, 15 Oct 2005)
New Revision: 1840

Modified:
   branches/r5rs/sigscheme/debug.c
   branches/r5rs/sigscheme/operations-siod.c
Log:
* Tentative fix to prevent SEGV with LIBUIM_VERBOSE=0.

* sigscheme/debug.c (SigScm_WriteToPort) : Check FALSEP before
  ASSERT_PORTP to avoid exit() when port is #f.
(SigScm_DisplayToPort) : Ditto.
* sigscheme/operation-siod.c (sscm_verbose_level) : Set initial
  value as -1.
(SigScm_SetVerboseLevel) : Return immediately if the level is not
  changed.  Fix to check scm_current_{error,output}_port with
  FALSEP when a verbose level will be raised from 0.


Modified: branches/r5rs/sigscheme/debug.c
===================================================================
--- branches/r5rs/sigscheme/debug.c	2005-10-14 05:05:16 UTC (rev 1839)
+++ branches/r5rs/sigscheme/debug.c	2005-10-15 15:05:03 UTC (rev 1840)
@@ -181,6 +181,9 @@
 {
     DECLARE_INTERNAL_FUNCTION("SigScm_WriteToPort");
 
+    if (FALSEP(port))
+	return;
+
     ASSERT_PORTP(port);
     if (SCM_PORT_PORTDIRECTION(port) != PORT_OUTPUT)
         SigScm_Error("output port is required");
@@ -197,6 +200,9 @@
 {
     DECLARE_INTERNAL_FUNCTION("SigScm_DisplayToPort");
 
+    if (FALSEP(port))
+	return;
+
     ASSERT_PORTP(port);
     if (SCM_PORT_PORTDIRECTION(port) != PORT_OUTPUT)
         SigScm_Error("output port is required");

Modified: branches/r5rs/sigscheme/operations-siod.c
===================================================================
--- branches/r5rs/sigscheme/operations-siod.c	2005-10-14 05:05:16 UTC (rev 1839)
+++ branches/r5rs/sigscheme/operations-siod.c	2005-10-15 15:05:03 UTC (rev 1840)
@@ -75,7 +75,7 @@
     SCM_DBG_SIOD_V4,
     SCM_DBG_SIOD_V5
 };
-static long sscm_verbose_level = 0;
+static long sscm_verbose_level = -1;
 
 static ScmObj saved_output_port  = NULL;
 static ScmObj saved_error_port  = NULL;
@@ -210,6 +210,9 @@
     if (level < 0)
         SigScm_Error("SigScm_SetVerboseLevel : negative value has been given");
 
+    if (sscm_verbose_level == level)
+	return;
+
     sscm_verbose_level = level;
 
     if (level > 5)
@@ -227,9 +230,9 @@
         scm_current_error_port = SCM_FALSE;
         scm_current_output_port = SCM_FALSE;
     } else {
-        if (!scm_current_error_port)
+        if (FALSEP(scm_current_error_port))
             scm_current_error_port = saved_error_port;
-        if (!scm_current_output_port)
+        if (FALSEP(scm_current_output_port))
             scm_current_output_port = saved_output_port;
     }
 }



More information about the uim-commit mailing list