mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 01:43:39 +00:00
Sparc: fix exceptions in delay slot
Fix a case where an exception happens with the instruction in the delay slot. Recovery of branch condition in the exception handling code was not converted to TCG. Because the condition was bogus, wrong NPC could be selected from the two candidates. A nice bug report with a test case can be found in: https://bugs.launchpad.net/qemu/+bug/551814 Fix based on patch by Fabrice Bellard. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
73f190352d
commit
d7da2a1040
|
@ -4932,12 +4932,12 @@ void gen_pc_load(CPUState *env, TranslationBlock *tb,
|
|||
if (npc == 1) {
|
||||
/* dynamic NPC: already stored */
|
||||
} else if (npc == 2) {
|
||||
target_ulong t2 = (target_ulong)(unsigned long)puc;
|
||||
/* jump PC: use T2 and the jump targets of the translation */
|
||||
if (t2)
|
||||
/* jump PC: use 'cond' and the jump targets of the translation */
|
||||
if (env->cond) {
|
||||
env->npc = gen_opc_jump_pc[0];
|
||||
else
|
||||
} else {
|
||||
env->npc = gen_opc_jump_pc[1];
|
||||
}
|
||||
} else {
|
||||
env->npc = npc;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue