aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/src/nil.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-08-22 09:07:00 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-08-22 09:07:00 +0000
commitd8366c2bf5359f7b65e612eb33379fed578c6d91 (patch)
tree920f0e20ac27e4207818fb1e0e280bda895e9ca1 /os/nil/src/nil.c
parent3caa603df42e9215259d6d2256da1c3911e7d8ae (diff)
downloadChibiOS-d8366c2bf5359f7b65e612eb33379fed578c6d91.tar.gz
ChibiOS-d8366c2bf5359f7b65e612eb33379fed578c6d91.tar.bz2
ChibiOS-d8366c2bf5359f7b65e612eb33379fed578c6d91.zip
Fixed bug #633 (tentative).
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8232 35acf78f-673a-0410-8e92-d51de3d6d3f4
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");
}
}