Skip to content

Fix LOCK 16-bit INC/DEC using 32-bit primop in interpreter path - #1070

Merged
ptitSeb merged 1 commit into
ptitSeb:masterfrom
As9xm:fix/lock-16bit-inc-dec-width
Sep 11, 2026
Merged

ptitSeb merged 1 commit into
ptitSeb:masterfrom
As9xm:fix/lock-16bit-inc-dec-width

Conversation

@As9xm

@As9xm As9xm commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

RunF066 handles F0 66 FF /0,/1 (LOCK INC/DEC Ew). The non-DYNAREC path applied inc32/dec32 to ED->dword[0], corrupting the upper 16 bits and computing OF/SF/ZF/AF/PF at the wrong operand width. The DYNAREC path just above correctly uses inc16/dec16, as does the non-LOCK Grp5 Ew handler in x86run66.c (EW->word[0] = inc16/dec16). Narrow the interpreter LOCK path to ED->word[0] with inc16/dec16.

RunF066 handles F0 66 FF /0,/1 (LOCK INC/DEC Ew). The non-DYNAREC path applied inc32/dec32 to ED->dword[0], corrupting the upper 16 bits and computing OF/SF/ZF/AF/PF at the wrong operand width. The DYNAREC path just above correctly uses inc16/dec16, as does the non-LOCK Grp5 Ew handler in x86run66.c (EW->word[0] = inc16/dec16). Narrow the interpreter LOCK path to ED->word[0] with inc16/dec16.
@ptitSeb
ptitSeb merged commit b05cb3a into ptitSeb:master Sep 11, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants