aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/src/nil.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/nil/src/nil.c')
-rw-r--r--os/nil/src/nil.c7
1 files changed, 4 insertions, 3 deletions
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");
}
}