pkarashchenko commented on a change in pull request #5754:
URL: https://github.com/apache/incubator-nuttx/pull/5754#discussion_r827721301
##########
File path: arch/risc-v/src/common/riscv_createstack.c
##########
@@ -218,7 +218,7 @@ void riscv_stack_color(void *stackbase, size_t nbytes)
uint32_t *stkptr = (uint32_t *)(((uintptr_t)stackbase + 3) & ~3);
uintptr_t stkend = nbytes ? (((uintptr_t)stackbase + nbytes) & ~3):
up_getsp(); /* 0: colorize the running stack */
- size_t nwords = (stkend - (uintptr_t)stackbase) >> 2;
+ size_t nwords = (stkend - (uintptr_t)(nbytes ? stackbase : stkptr)) >> 2;
Review comment:
what about other archs? Do they have the same issue?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]