Skip to content

Fix 16-bit disp16 precedence bug in getecommon16o - #1066

Merged
ptitSeb merged 1 commit into
ptitSeb:masterfrom
As9xm:fix/modrm-16bit-disp16-precedence
Sep 10, 2026
Merged

ptitSeb merged 1 commit into
ptitSeb:masterfrom
As9xm:fix/modrm-16bit-disp16-precedence

Conversation

@As9xm

@As9xm As9xm commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

In C, == binds tighter than &, so 'm&7==6' parsed as 'm&(7==6)' = 'm&0' = always false. Disp16 was never fetched for mod==00,rm==110 16-bit addressing (GET_EW16_OFFS), leaving a wrong effective address and unadvanced EIP. Parenthesize as '(m&7)==6' to match getecommon16.

In C, == binds tighter than &, so 'm&7==6' parsed as 'm&(7==6)' = 'm&0' = always false. Disp16 was never fetched for mod==00,rm==110 16-bit addressing (GET_EW16_OFFS), leaving a wrong effective address and unadvanced EIP. Parenthesize as '(m&7)==6' to match getecommon16.
@ptitSeb
ptitSeb merged commit 9a67cb9 into ptitSeb:master Sep 10, 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