From 5005b4a6e2a4493d4cff435dcade4e9331b11659 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Thu, 17 Sep 2015 09:16:57 +0700 Subject: [PATCH] arm: early check to see if the address of this block is the until address --- qemu/target-arm/translate.c | 7 +++++++ 1 file changed, 7 insertions(+) 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