Don't call hooks if there is already an unhandled exception

This commit is contained in:
lazymio 2022-05-20 13:15:23 +02:00
parent 0d41d4bbb2
commit 5d37e21db5
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
1 changed files with 32 additions and 27 deletions

View File

@ -1441,6 +1441,8 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
// memory might be still unmapped while reading or fetching
if (mr == NULL) {
handled = false;
// if there is already an unhandled eror, skip callbacks.
if (uc->invalid_error == UC_ERR_OK) {
if (code_read) {
// code fetching
error_code = UC_ERR_FETCH_UNMAPPED;
@ -1472,6 +1474,9 @@ load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi,
break;
}
}
} else {
error_code = uc->invalid_error;
}
if (handled) {
uc->invalid_error = UC_ERR_OK;