From 0e873b51c63d452c08d60a38ce0bc4593d713a1b Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 22 Feb 2023 12:34:48 +0800 Subject: [PATCH] arm/backtrace/unwind: skip unaligned instruction Signed-off-by: chao an --- arch/arm/src/common/arm_backtrace_unwind.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/common/arm_backtrace_unwind.c b/arch/arm/src/common/arm_backtrace_unwind.c index 22ea4acd17..2d37573989 100644 --- a/arch/arm/src/common/arm_backtrace_unwind.c +++ b/arch/arm/src/common/arm_backtrace_unwind.c @@ -470,7 +470,11 @@ int unwind_frame(struct unwind_frame_s *frame) /* Check the personality routine */ - if ((*ctrl.insn & 0xff000000) == 0x80000000) + if (((uintptr_t)ctrl.insn & 0x3) != 0) + { + return -1; + } + else if ((*ctrl.insn & 0xff000000) == 0x80000000) { ctrl.byte = 2; ctrl.entries = 1;