Skip to content

disasm: fix truncation 32bit left bitwise shift - #285

Open
GermanAizek wants to merge 1 commit into
netwide-assembler:masterfrom
GermanAizek:fix-trunc-bitwise
Open

disasm: fix truncation 32bit left bitwise shift#285
GermanAizek wants to merge 1 commit into
netwide-assembler:masterfrom
GermanAizek:fix-trunc-bitwise

Conversation

@GermanAizek

@GermanAizek GermanAizek commented Aug 1, 2026

Copy link
Copy Markdown

Even though shifting an 8-bit displacement usually won't exceed a 32-bit boundary, static analyzer flags it because a negative value (which has its sign bit extended into the 32-bit space) shifted left and then promoted to 64 bits can result in improper sign-extension or unintended data truncation at the 32-bit boundary

Even though shifting an 8-bit displacement usually won't exceed a 32-bit boundary, static analyzer flags it because a negative value (which has its sign bit extended into the 32-bit space) shifted left and then promoted to 64 bits can result in improper sign-extension or unintended data truncation at the 32-bit boundary.
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.

1 participant