when block size is unknown because the translation cache is full, assign it value 0

This commit is contained in:
Nguyen Anh Quynh
2015-08-25 16:10:05 +08:00
parent c3e95ec34e
commit 39d3856871
2 changed files with 5 additions and 3 deletions

View File

@@ -179,8 +179,10 @@ static int cpu_gen_code(CPUArchState *env, TranslationBlock *tb, int *gen_code_s
gen_intermediate_code(env, tb);
// Unicorn: when tracing block, patch 1st operand for block size
if (env->uc->hook_block) {
if (env->uc->block_addr == tb->pc)
if (env->uc->hook_block && env->uc->block_addr == tb->pc) {
if (env->uc->block_full) // block size is unknown
*(s->gen_opparam_buf + 1) = 0;
else
*(s->gen_opparam_buf + 1) = tb->size;
}