Skip to content

Commit

Permalink
arm: fix backtrace busyloop
Browse files Browse the repository at this point in the history
Signed-off-by: ligd <liguiding1@xiaomi.com>
  • Loading branch information
GUIDINGLI authored and xiaoxiang781216 committed Sep 8, 2022
1 parent f29b301 commit 03b987f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arch/arm/src/common/arm_backtrace_fp.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ static int backtrace(uintptr_t *base, uintptr_t *limit,

if (pc)
{
i++;
if ((*skip)-- <= 0)
{
*buffer++ = pc;
buffer[i++] = pc;
}
}

for (; i < size; fp = (uintptr_t *)*(fp - 1), i++)
for (; i < size; fp = (uintptr_t *)*(fp - 1))
{
if (fp > limit || fp < base || *fp == 0)
{
Expand All @@ -68,7 +67,7 @@ static int backtrace(uintptr_t *base, uintptr_t *limit,

if ((*skip)-- <= 0)
{
*buffer++ = (void *)*fp;
buffer[i++] = (void *)*fp;
}
}

Expand Down

0 comments on commit 03b987f

Please sign in to comment.