Skip to content

Comments

decompiler: fix INT_LEFT for constant bitshift by 0 and varnodes > 8#8706

Closed
fkil wants to merge 1 commit intoNationalSecurityAgency:masterfrom
fkil:ghidra_issue_8705
Closed

decompiler: fix INT_LEFT for constant bitshift by 0 and varnodes > 8#8706
fkil wants to merge 1 commit intoNationalSecurityAgency:masterfrom
fkil:ghidra_issue_8705

Conversation

@fkil
Copy link
Contributor

@fkil fkil commented Nov 27, 2025

Fixes #8705

In case of a 0-bitshift, the mask computation was performing a 64-bit shift, assuming the result will be 0. However, such a bitshift is undefined and will be equal to a NOP on some architectures.

This is fixed by explicitly checking for a shift-amount of 0.

Fixes NationalSecurityAgency#8705

In case of a 0-bitshift, the mask computation was performing a 64-bit shift,
assuming the result will be 0. However, such a bitshift is undefined and
will be equal to a NOP on some architectures.

This is fixed by explicitly checking for a shift-amount of 0.
@jobermayr
Copy link
Contributor

Fixed: 402d10d

@ryanmkurtz ryanmkurtz added the Reason: OBE This has been "overcome by events." label Feb 19, 2026
@ryanmkurtz ryanmkurtz added this to the 12.1 milestone Feb 19, 2026
@ryanmkurtz ryanmkurtz removed the Status: Triage Information is being gathered label Feb 19, 2026
@ryanmkurtz ryanmkurtz closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature: Decompiler Reason: OBE This has been "overcome by events."

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decompiler: Wrong consumption mask computation for zero-bit left shift if varnode's size > sizeof(uintb)

4 participants