Skip to content

Redundant condition in decompilation #2504

@comex

Description

@comex

Binary Ninja Version
Version 2.3.2811-dev (Build ID 86f5afe6)

Describe the bug
For certain input, the HLIL view shows:

if (arg1 != 0 || (arg1 == 0 && arg2 s>= 1))

But arg1 == 0 is redundant here. It could be written as just

if (arg1 != 0 || arg2 s>= 1)

To Reproduce

    cmp x0, #0
    b.ne 2f
    cmp x1, #1
    b.lt 3f
2:
    str xzr, [x3]
3:
    ret

Version and Platform (required):

  • Binary Ninja: Version 2.3.2811-dev (Build ID 86f5afe6)
  • OS: macOS
  • Version 11.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreIssue needs changes to the coreCore: HLILIssue involves High Level ILEffort: MediumIssues require < 1 month of workIL OptimizationIssue involving optimization of representation (not correctness)Impact: MediumIssue is impactful with a bad, or no, workaround

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions