From 3a023f4d1a0fe967b154345da7da79085be77943 Mon Sep 17 00:00:00 2001 From: ligd Date: Thu, 4 Aug 2022 21:28:25 +0800 Subject: [PATCH] arm: fix backtrace busyloop Signed-off-by: ligd --- arch/arm/src/common/arm_backtrace_fp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/common/arm_backtrace_fp.c b/arch/arm/src/common/arm_backtrace_fp.c index 7404932b1a..f7978716f4 100644 --- a/arch/arm/src/common/arm_backtrace_fp.c +++ b/arch/arm/src/common/arm_backtrace_fp.c @@ -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; } }