mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
arch: fixed error in the calculation of nwords caused an out of bounds
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
parent
a581b99266
commit
12bb4f04f1
7 changed files with 7 additions and 7 deletions
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue