uc_emu_start() report error on illegal instruction at the output

This commit is contained in:
Nguyen Anh Quynh
2015-08-25 00:02:31 +08:00
parent 84e01e6c05
commit 9d9c0d1a25
5 changed files with 48 additions and 6 deletions

10
uc.c
View File

@ -410,6 +410,11 @@ uc_err uc_emu_start(uch handle, uint64_t begin, uint64_t until, uint64_t timeout
// invalid handle
return UC_ERR_UCH;
// reset the counter
uc->emu_counter = 0;
uc->stop_request = false;
uc->invalid_error = UC_ERR_OK;
switch(uc->arch) {
default:
break;
@ -474,11 +479,6 @@ uc_err uc_emu_start(uch handle, uint64_t begin, uint64_t until, uint64_t timeout
// emulation is done
uc->emulation_done = true;
// reset the counter
uc->emu_counter = 0;
uc->stop_request = false;
uc->invalid_error = UC_ERR_OK;
return uc->invalid_error;
}