Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompiler: RuleIgnoreNan: Don't descend if NAN flow has been removed #6581

Conversation

LukeSerne
Copy link
Contributor

Sometimes, when RuleIgnoreNan tries to remove NAN-branches from conditionals, it is too aggressive and also removes other branches, leading to incorrect decompiler output. By returning a null pointer if the NAN flow has been removed by replacing the boolean operation such as BOOL_AND or BOOL_OR by a COPY operation, we avoid descending down further and removing too much of the tree.

Fixes #6580

Sometimes, when `RuleIgnoreNan` tries to remove NaN-branches from conditionals,
it is too aggressive and also removes other branches, leading to incorrect
decompiler output. By returning a null pointer if the NAN flow has been removed
by replacing the boolean combinator such as `BOOL_AND` or `BOOL_OR` by a `COPY`
operation, we avoid descending down further and removing too much of the tree.
@ryanmkurtz ryanmkurtz added Feature: Decompiler Status: Triage Information is being gathered labels May 28, 2024
@ryanmkurtz ryanmkurtz added Status: Internal This is being tracked internally by the Ghidra team and removed Status: Triage Information is being gathered labels Jul 8, 2024
@ryanmkurtz ryanmkurtz added this to the 11.1.3 milestone Jul 10, 2024
@ryanmkurtz ryanmkurtz modified the milestones: 11.1.3, 11.2 Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Decompiler Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decompiler: RuleIgnoreNan is too aggressive when removing NaN branches
3 participants