diff --git a/arch/arm/src/common/arm_checkstack.c b/arch/arm/src/common/arm_checkstack.c index 80d1c323ab..e32994d635 100644 --- a/arch/arm/src/common/arm_checkstack.c +++ b/arch/arm/src/common/arm_checkstack.c @@ -172,7 +172,7 @@ void arm_stack_color(void *stackbase, size_t nbytes) } stkend = STACK_ALIGN_DOWN(stkend); - nwords = (stkend - (uintptr_t)stackbase) >> 2; + nwords = (stkend - (uintptr_t)stkptr) >> 2; /* Set the entire stack to the coloration value */ diff --git a/arch/ceva/src/common/ceva_createstack.c b/arch/ceva/src/common/ceva_createstack.c index ed7738df0b..64c2eb134e 100644 --- a/arch/ceva/src/common/ceva_createstack.c +++ b/arch/ceva/src/common/ceva_createstack.c @@ -253,7 +253,7 @@ void ceva_stack_color(void *stackbase, size_t nbytes) } stkend = STACK_ALIGN_DOWN(stkend); - nwords = (stkend - (uintptr_t)stackbase) >> 2; + nwords = (stkend - (uintptr_t)stkptr) >> 2; /* Set the entire stack to the coloration value */ diff --git a/arch/or1k/src/common/or1k_createstack.c b/arch/or1k/src/common/or1k_createstack.c index e4e36d211b..87725f493b 100644 --- a/arch/or1k/src/common/or1k_createstack.c +++ b/arch/or1k/src/common/or1k_createstack.c @@ -226,7 +226,7 @@ void or1k_stack_color(void *stackbase, size_t nbytes) } stkend = STACK_ALIGN_DOWN(stkend); - nwords = (stkend - (uintptr_t)stackbase) >> 2; + nwords = (stkend - (uintptr_t)stkptr) >> 2; /* Set the entire stack to the coloration value */ diff --git a/arch/risc-v/src/common/riscv_createstack.c b/arch/risc-v/src/common/riscv_createstack.c index c15e1b0e81..122710fb60 100644 --- a/arch/risc-v/src/common/riscv_createstack.c +++ b/arch/risc-v/src/common/riscv_createstack.c @@ -236,7 +236,7 @@ void riscv_stack_color(void *stackbase, size_t nbytes) } stkend = STACK_ALIGN_DOWN(stkend); - nwords = (stkend - (uintptr_t)stackbase) >> 2; + nwords = (stkend - (uintptr_t)stkptr) >> 2; /* Set the entire stack to the coloration value */ diff --git a/arch/sim/src/sim/sim_createstack.c b/arch/sim/src/sim/sim_createstack.c index fc7557b382..fe91dd7e25 100644 --- a/arch/sim/src/sim/sim_createstack.c +++ b/arch/sim/src/sim/sim_createstack.c @@ -188,7 +188,7 @@ void nostackprotect_function sim_stack_color(void *stackbase, } stkend = STACK_ALIGN_DOWN(stkend); - nwords = (stkend - (uintptr_t)stackbase) >> 2; + nwords = (stkend - (uintptr_t)stkptr) >> 2; nwords = nwords > STACK_MARGIN_WORDS ? nwords - STACK_MARGIN_WORDS : 0; /* Set the entire stack to the coloration value */ diff --git a/arch/sparc/src/common/sparc_checkstack.c b/arch/sparc/src/common/sparc_checkstack.c index b56653d79f..1a71098434 100644 --- a/arch/sparc/src/common/sparc_checkstack.c +++ b/arch/sparc/src/common/sparc_checkstack.c @@ -172,7 +172,7 @@ void sparc_stack_color(void *stackbase, size_t nbytes) } stkend = STACK_ALIGN_DOWN(stkend); - nwords = (stkend - (uintptr_t)stackbase) >> 2; + nwords = (stkend - (uintptr_t)stkptr) >> 2; /* Set the entire stack to the coloration value */ diff --git a/arch/xtensa/src/common/xtensa_createstack.c b/arch/xtensa/src/common/xtensa_createstack.c index d8a972ee08..24b24eb197 100644 --- a/arch/xtensa/src/common/xtensa_createstack.c +++ b/arch/xtensa/src/common/xtensa_createstack.c @@ -242,7 +242,7 @@ void xtensa_stack_color(void *stackbase, size_t nbytes) } stkend = STACK_ALIGN_DOWN(stkend); - nwords = (stkend - (uintptr_t)stackbase) >> 2; + nwords = (stkend - (uintptr_t)stkptr) >> 2; /* Set the entire stack to the coloration value */