Skip to content

Commit 1aed7e0

Browse files
authored
Fix missing braces in x64run0f.c opcode 0x00 handler (#3471)
The else branch at line 89 was missing braces, causing the second switch statement to always execute regardless of rex.is32bits. In 32-bit mode, after the first switch handled instructions like VERR/VERW (cases 4/5), the second switch would also run and hit default, returning 0.
1 parent b3b7f3a commit 1aed7e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/emu/x64run0f.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,20 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
8686
default:
8787
return 0;
8888
}
89-
} else
89+
} else {
9090
nextop = F8;
9191
switch((nextop>>3)&7) {
9292
case 0: /* SLDT Ew */
9393
GETEW(0);
9494
if(MODREG)
9595
ED->q[0] = 0;
96-
else
96+
else
9797
EW->word[0] = 0;
9898
break;
9999
default:
100100
return 0;
101101
}
102+
}
102103
break;
103104
case 0x01: /* XGETBV, SGDT, etc... */
104105
nextop = F8;

0 commit comments

Comments
 (0)