You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/09 05:57:37 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4961: arch/arm/assert: fix the stack dump overflow

xiaoxiang781216 commented on a change in pull request #4961:
URL: https://github.com/apache/incubator-nuttx/pull/4961#discussion_r765453185



##########
File path: arch/arm/src/armv6-m/arm_assert.c
##########
@@ -76,7 +76,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
-  for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
+  for (stack = sp & ~0x1f; stack < stack_top - 32; stack += 32)

Review comment:
       let's modify other arch too

##########
File path: arch/arm/src/arm/arm_assert.c
##########
@@ -77,7 +77,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
-  for (stack = sp & ~0x1f; stack < stack_top; stack += 32)
+  for (stack = sp & ~0x1f; stack < stack_top - 32; stack += 32)

Review comment:
       should be stack_top &~0x1f




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org