diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/osal/nil/osal.c | 7 | ||||
-rw-r--r-- | os/nil/src/nil.c | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/os/hal/osal/nil/osal.c b/os/hal/osal/nil/osal.c index 2c500f4b6..f935e6e8c 100644 --- a/os/hal/osal/nil/osal.c +++ b/os/hal/osal/nil/osal.c @@ -96,6 +96,10 @@ void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { sp->cnt = (cnt_t)0;
tr = nil.threads;
while (cnt < (cnt_t)0) {
+
+ chDbgAssert(tr < &nil.threads[NIL_CFG_NUM_THREADS],
+ "pointer out of range");
+
/* Is this thread waiting on this semaphore?*/
if (tr->u1.semp == sp) {
@@ -105,9 +109,6 @@ void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { (void) chSchReadyI(tr, msg);
}
tr++;
-
- chDbgAssert(tr < &nil.threads[NIL_CFG_NUM_THREADS],
- "pointer out of range");
}
}
diff --git a/os/nil/src/nil.c b/os/nil/src/nil.c index 7d3dab9ce..c57572b23 100644 --- a/os/nil/src/nil.c +++ b/os/nil/src/nil.c @@ -713,6 +713,10 @@ void chSemResetI(semaphore_t *sp, cnt_t n) { sp->cnt = n;
tp = nil.threads;
while (cnt < (cnt_t)0) {
+
+ chDbgAssert(tp < &nil.threads[NIL_CFG_NUM_THREADS],
+ "pointer out of range");
+
/* Is this thread waiting on this semaphore?*/
if (tp->u1.semp == sp) {
@@ -722,9 +726,6 @@ void chSemResetI(semaphore_t *sp, cnt_t n) { (void) chSchReadyI(tp, MSG_RESET);
}
tp++;
-
- chDbgAssert(tp < &nil.threads[NIL_CFG_NUM_THREADS],
- "pointer out of range");
}
}
|