]> git.pond.sub.org Git - empserver/commitdiff
[BOUNDS_CHECK]: Defunct, remove.
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 5 Dec 2005 22:58:23 +0000 (22:58 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 5 Dec 2005 22:58:23 +0000 (22:58 +0000)
(lwpReschedule): Fix potential crash bug that crept in with
BOUNDS_CHECK years ago.

src/lib/lwp/lwp.c
src/lib/lwp/status.c

index 19f611b6238b9f675175dc1f9b0fb4f14519f9ac..23d35ef83484de3767813c21b67799433bc817e0 100644 (file)
 
 #if defined(_EMPTH_LWP)
 
-#ifdef BOUNDS_CHECK
-#include <bounds/fix-args.h>
-#include <bounds/unchecked.h>
-#endif
-
 struct lwpQueue LwpSchedQ[LWP_MAX_PRIO], LwpDeadQ;
 
 struct lwpProc *LwpCurrent = NULL;
@@ -53,16 +48,7 @@ static int
 growsdown(void *x)
 {
     int y;
-
-#ifdef BOUNDS_CHECK
-    BOUNDS_CHECKING_OFF;
-#endif
     y = (x > (void *)&y);
-
-#ifdef BOUNDS_CHECK
-    BOUNDS_CHECKING_ON;
-#endif
-
     return y;
 }
 
@@ -111,7 +97,6 @@ lwpReschedule(void)
                lwpAddTail(&LwpDeadQ, nextp);
            } else {
                lwpDestroy(nextp);
-/*                             fprintf(stderr,  "Destroying done\n"); */
            }
            nextp = 0;
        }
@@ -125,28 +110,12 @@ lwpReschedule(void)
     if (LwpCurrent)
        lwpStatus(LwpCurrent, "switch out");
     /* do context switch */
-#ifdef BOUNDS_CHECK
-    BOUNDS_CHECKING_OFF;
-#endif
-
-    i = lwpSave(LwpCurrent->context);
-#ifdef BOUNDS_CHECK
-    BOUNDS_CHECKING_ON;
-#endif
-
-    if (LwpCurrent != nextp && !(LwpCurrent && i)) {
+    if (LwpCurrent != nextp && !(LwpCurrent && lwpSave(LwpCurrent->context))) {
        /* restore previous context */
        lwpStatus(nextp, "switch in %d", nextp->pri);
        LwpCurrent = nextp;
        *LwpContextPtr = LwpCurrent->ud;
-#ifdef BOUNDS_CHECK
-       BOUNDS_CHECKING_OFF;
-#endif
        lwpRestore(LwpCurrent->context);
-
-#ifdef BOUNDS_CHECK
-       BOUNDS_CHECKING_ON;
-#endif
     }
 }
 
@@ -158,9 +127,6 @@ lwpEntryPoint(void)
 {
     sigset_t set;
 
-#ifdef BOUNDS_CHECK
-    BOUNDS_CHECKING_OFF;
-#endif
     sigemptyset(&set);
     sigaddset(&set, SIGALRM);
     sigprocmask(SIG_SETMASK, &set, &oldmask);
@@ -169,11 +135,6 @@ lwpEntryPoint(void)
     lwpStatus(LwpCurrent, "starting at entry point");
     (*LwpCurrent->entry)(LwpCurrent->ud);
     lwpExit();
-#ifdef BOUNDS_CHECK
-    BOUNDS_CHECKING_ON;
-#endif
-
-
 }
 
 /*
index 9d0a7d07725957b3a47e6ad4b6ff11ddd568fe95..f86348203e012042be883552f2aea932525c3397 100644 (file)
@@ -33,9 +33,6 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-#ifdef BOUNDS_CHECK
-#include <bounds/fix-args.h>
-#endif
 #include "lwp.h"
 
 #if defined(_EMPTH_LWP)