Skip to content

Invalid union access and inability to change it's field resolution in If statement #7592

@teropentis64

Description

@teropentis64

Version and Platform (required):

  • 5.2.8587-dev
  • macOS 15.6.1
  • Intel

Bug Description:
Union's struct members are wrongly addressed and I can't change it.

Steps To Reproduce:
as in images below

Expected Behavior:
as showed on image from IDA

Screenshots/Video Recording:

Context: var_48 is allocated on stack.

  1. Here Binary Ninja incorrectly shows access to heap.b, technically it's not incorrect but I would like to set it to heap.flags which is marked as incorrect here. Trying to change it to the incorrect field (or even correct one, the sso.size) does nothing. It's just ignored.
Image
  1. It shows invalid. Clicking on the invalid field resolution does not change it anyway as mentioned.
Image
  1. The only way to change what it resolves to is to change of order in the struct sstring (swap sso with heap).
Image
  1. IDA has no problems with the same type.
Image

It seems like it only occurs when the field reference is in if statement (as far as I noticed for now), I can change it freely when some var is assigned to the field elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions