stop emulation when hitting invalid code address. this fixes issue #82

This commit is contained in:
Nguyen Anh Quynh
2015-09-01 00:17:55 +08:00
parent 12019dba40
commit bea73ef213
2 changed files with 7 additions and 1 deletions

View File

@@ -205,6 +205,8 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq
have_tb_lock = true;
tb = tb_find_fast(env); // qq
if (!tb) { // invalid TB due to invalid code?
uc->invalid_error = UC_ERR_CODE_INVALID;
ret = EXCP_HLT;
break;
}
/* Note: we do it here to avoid a gcc bug on Mac OS X when