mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-24 23:41:09 +00:00
x86: set s->pc in disas_insn() early to fix uninitialized read issue. bug reported by @farmdve
This commit is contained in:
parent
06108ea908
commit
075ccadbe9
|
@ -4751,6 +4751,8 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
|
||||||
bool changed_cc_op = false;
|
bool changed_cc_op = false;
|
||||||
|
|
||||||
|
|
||||||
|
s->pc = pc_start;
|
||||||
|
|
||||||
// end address tells us to stop emulation
|
// end address tells us to stop emulation
|
||||||
if (s->pc == s->uc->addr_end) {
|
if (s->pc == s->uc->addr_end) {
|
||||||
// imitate the HLT instruction
|
// imitate the HLT instruction
|
||||||
|
@ -4781,7 +4783,6 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s->pc = pc_start;
|
|
||||||
prefixes = 0;
|
prefixes = 0;
|
||||||
s->override = -1;
|
s->override = -1;
|
||||||
rex_w = -1;
|
rex_w = -1;
|
||||||
|
|
Loading…
Reference in a new issue