mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-10 23:45:33 +00:00
x86: verify until address early when translating block in frontend. this should fix issue #63
This commit is contained in:
parent
adec227dad
commit
4a1c5ff071
|
@ -117,13 +117,6 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq
|
||||||
(uc->arch == UC_ARCH_M68K && cpu->exception_index == 0x2f) /* M68K's EXCP_TRAP15 */
|
(uc->arch == UC_ARCH_M68K && cpu->exception_index == 0x2f) /* M68K's EXCP_TRAP15 */
|
||||||
) {
|
) {
|
||||||
cpu->halted = 1;
|
cpu->halted = 1;
|
||||||
//cpu->exception_index = EXCP_HLT;
|
|
||||||
//no_shutdown = 0;
|
|
||||||
//printf(">>> calling shutdown-request...\n");
|
|
||||||
//printf(">>> ** current EIP = %x\n", X86_CPU(cpu)->env.eip);
|
|
||||||
//qemu_system_shutdown_request();
|
|
||||||
//pause_all_vcpus();
|
|
||||||
//cpu_loop_exit(cpu);
|
|
||||||
ret = EXCP_HLT;
|
ret = EXCP_HLT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8254,7 +8254,7 @@ static inline void gen_intermediate_code_internal(uint8_t *gen_opc_cc_op,
|
||||||
uint64_t flags;
|
uint64_t flags;
|
||||||
target_ulong pc_start;
|
target_ulong pc_start;
|
||||||
target_ulong cs_base;
|
target_ulong cs_base;
|
||||||
int num_insns;
|
int num_insns = 0;
|
||||||
int max_insns;
|
int max_insns;
|
||||||
bool block_full = false;
|
bool block_full = false;
|
||||||
|
|
||||||
|
@ -8339,12 +8339,18 @@ static inline void gen_intermediate_code_internal(uint8_t *gen_opc_cc_op,
|
||||||
// done with initializing TCG variables
|
// done with initializing TCG variables
|
||||||
env->uc->init_tcg = true;
|
env->uc->init_tcg = true;
|
||||||
|
|
||||||
|
// 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_interrupt(dc, 0x99, tb->pc - tb->cs_base, tb->pc - tb->cs_base);
|
||||||
|
goto done_generating;
|
||||||
|
}
|
||||||
|
|
||||||
gen_opc_end = tcg_ctx->gen_opc_buf + OPC_MAX_SIZE;
|
gen_opc_end = tcg_ctx->gen_opc_buf + OPC_MAX_SIZE;
|
||||||
|
|
||||||
dc->is_jmp = DISAS_NEXT;
|
dc->is_jmp = DISAS_NEXT;
|
||||||
pc_ptr = pc_start;
|
pc_ptr = pc_start;
|
||||||
lj = -1;
|
lj = -1;
|
||||||
num_insns = 0;
|
|
||||||
max_insns = tb->cflags & CF_COUNT_MASK;
|
max_insns = tb->cflags & CF_COUNT_MASK;
|
||||||
if (max_insns == 0)
|
if (max_insns == 0)
|
||||||
max_insns = CF_COUNT_MASK;
|
max_insns = CF_COUNT_MASK;
|
||||||
|
|
Loading…
Reference in a new issue