aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/IAR/ARMCMx/chcore_v7m.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/ports/IAR/ARMCMx/chcore_v7m.h')
-rw-r--r--os/ports/IAR/ARMCMx/chcore_v7m.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/os/ports/IAR/ARMCMx/chcore_v7m.h b/os/ports/IAR/ARMCMx/chcore_v7m.h
index 059f29711..086a99d39 100644
--- a/os/ports/IAR/ARMCMx/chcore_v7m.h
+++ b/os/ports/IAR/ARMCMx/chcore_v7m.h
@@ -306,7 +306,7 @@ struct intctx {
#define port_switch(ntp, otp) _port_switch(ntp, otp)
#else
#define port_switch(ntp, otp) { \
- if ((void *)(__get_SP() - sizeof(struct intctx)) < (void *)(otp + 1)) \
+ if ((stkalign_t *)(__get_SP() - sizeof(struct intctx)) < otp->p_stklimit) \
chDbgPanic("stack overflow"); \
_port_switch(ntp, otp); \
}