arm: fix backtrace busyloop

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-08-04 21:28:25 +08:00 committed by Xiang Xiao
parent b3ebe66ff5
commit 3a023f4d1a

View file

@ -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)
{
@ -68,7 +67,7 @@ static int backtrace(uintptr_t *base, uintptr_t *limit,
if ((*skip)-- <= 0)
{
*buffer++ = (void *)*fp;
buffer[i++] = (void *)*fp;
}
}