You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/12/05 11:55:13 UTC

[GitHub] [mynewt-core] kasjer commented on a change in pull request #2123: Fix references to t_stacktop

kasjer commented on a change in pull request #2123: Fix references to t_stacktop
URL: https://github.com/apache/mynewt-core/pull/2123#discussion_r354265429
 
 

 ##########
 File path: kernel/os/src/os_stacktrace.c
 ##########
 @@ -78,14 +78,16 @@ os_stacktrace(uintptr_t sp)
     uintptr_t addr;
     uintptr_t end;
     struct os_task *t;
+    os_stack_t *stacktop;
 
     sp &= ~(sizeof(uintptr_t) - 1);
     end = sp + OS_STACK_DEPTH_MAX;
 
     if (g_os_started && g_current_task) {
         t = g_current_task;
-        if (sp > (uintptr_t)t->t_stacktop && end > (uintptr_t)t->t_stacktop) {
-            end = (uintptr_t)t->t_stacktop;
+        stacktop = os_task_stacktop_get(t);
+        if (sp > (uintptr_t)stacktop && end > (uintptr_t)stacktop) {
 
 Review comment:
   first condition `sp > stacktop` does not make sense in this check and will most likely result in extra values being printed in loop below.
   In normal case **sp** will never be greater then **stacktop** making this condition to evaluate to false even if **end** is greater then **stacktop**.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services