diff --git a/qemu/target-arm/translate.c b/qemu/target-arm/translate.c index a3829ca2..8875b641 100644 --- a/qemu/target-arm/translate.c +++ b/qemu/target-arm/translate.c @@ -11228,6 +11228,13 @@ static inline void gen_intermediate_code_internal(ARMCPU *cpu, tcg_clear_temp_count(); + // Unicorn: early check to see if the address of this block is the until address + if (tb->pc == env->uc->addr_end) { + gen_tb_start(tcg_ctx); + gen_exception_insn(dc, 0, EXCP_SWI, 0); + goto done_generating; + } + // Unicorn: trace this block on request // Only hook this block if it is not broken from previous translation due to // full translation cache