From: Keith Packard Date: Sat, 8 Aug 2020 03:08:34 +0000 (-0700) Subject: altos/stm: Fix stack validation code X-Git-Tag: 1.9.5~1^2~55 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=304dbcbff72c6fa66c71224ecf98ec55447ffff7;p=fw%2Faltos altos/stm: Fix stack validation code This is not included by default, and broke at some point. Signed-off-by: Keith Packard --- diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h index 8f4f6cd4..083f7a2b 100644 --- a/src/stm/ao_arch_funcs.h +++ b/src/stm/ao_arch_funcs.h @@ -562,8 +562,8 @@ ao_validate_cur_stack(void) asm("mrs %0,psp" : "=&r" (psp)); if (ao_cur_task && - psp <= ao_cur_task->stack && - psp >= ao_cur_task->stack - 256) + (psp <= ao_cur_task->stack8 || + psp >= ao_cur_task->stack8 + AO_STACK_SIZE)) ao_panic(AO_PANIC_STACK); } #endif