pkarashchenko commented on a change in pull request #5007:
URL: https://github.com/apache/incubator-nuttx/pull/5007#discussion_r769678090



##########
File path: arch/z16/src/common/z16_stackdump.c
##########
@@ -68,8 +69,12 @@ static void z16_stackdump(void)
       stack = stack_base;
     }
 
+  /* Flush any buffered SYSLOG data to avoid overwrite */
+
+  syslog_flush();
+
   for (stack = stack & ~0x0f;
-       stack < stack_base + stack_size;
+       stack < ((stack_base + stack_size) & ~0x1f);

Review comment:
       ```suggestion
          stack < ((stack_base + stack_size) & ~0x0f);
   ```
   or for better compatibility:
   ```
     for (stack = stack & ~(8 * sizeof(chipreg_t) - 1);
          stack < ((stack_base + stack_size) & ~(8 * sizeof(chipreg_t) - 1));
          stack += 8 * sizeof(chipreg_t))
   ```




-- 
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]


Reply via email to