Don't sync pc if user requests a restart

This commit is contained in:
Mio 2022-08-31 23:26:40 +08:00
parent c4a0813f4a
commit 092014a6cc
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873

View File

@ -86,11 +86,14 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb)
case UC_ERR_FETCH_UNALIGNED:
break;
default:
if (cc->synchronize_from_tb) {
cc->synchronize_from_tb(cpu, last_tb);
} else {
assert(cc->set_pc);
cc->set_pc(cpu, last_tb->pc);
// If we receive a quit request, users has sync-ed PC themselves.
if (!cpu->uc->quit_request) {
if (cc->synchronize_from_tb) {
cc->synchronize_from_tb(cpu, last_tb);
} else {
assert(cc->set_pc);
cc->set_pc(cpu, last_tb->pc);
}
}
}
}