From e03109d8c9672956e1af1af88c09cadae9cd147a Mon Sep 17 00:00:00 2001 From: mio Date: Fri, 8 Mar 2024 17:31:27 +0800 Subject: [PATCH] Respect users' decision for UC_ERR_INSN_INVALID --- qemu/accel/tcg/cpu-exec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qemu/accel/tcg/cpu-exec.c b/qemu/accel/tcg/cpu-exec.c index d8957b85..f938cfaa 100644 --- a/qemu/accel/tcg/cpu-exec.c +++ b/qemu/accel/tcg/cpu-exec.c @@ -354,11 +354,10 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret) } if (!catched) { uc->invalid_error = UC_ERR_INSN_INVALID; + // we want to stop emulation + *ret = EXCP_HLT; + return true; } - - // we want to stop emulation - *ret = EXCP_HLT; - return true; } if (cpu->exception_index < 0) {