NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
49.09k stars 5.65k forks source link

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

Open LukeSerne opened 1 month ago

LukeSerne commented 1 month ago

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