Skip to content

Changing return type to one requiring indirect return does not update parameter locations #8429

Description

@bdash

Version and Platform (required):

  • Binary Ninja Version: 5.4.10468-dev Ultimate, 32fed8b7
  • OS: macos
  • OS Version: 26.5.2
  • CPU Architecture: arm64

Bug Description:
Changing the return type of a function in a mac-x86_64 binary:

100000390    struct Class* Class::big(struct Class* this)

to Big results in:

100000390    struct Big Class::big(struct Class* this @ rdi)

Big is:

struct Big
{
    int64_t a;
    int64_t b;
    int64_t c;
    int64_t d;
};

and causes the return value to be passed indirectly. this should move to rsi, but becomes explicitly pinned to rdi.

Steps To Reproduce:

  1. Download dynamic mountain raises freely.
  2. Define these types:
struct Big
{
    int64_t a;
    int64_t b;
    int64_t c;
    int64_t d;
};

struct Class
{
    int64_t x;
};

struct Huge
{
    int64_t v[0x10];
};

struct Pair
{
    int64_t a;
    int64_t b;
};

struct Small
{
    int64_t a;
};
  1. Change the return types of each of Class::small, Class::pair, Class::big, and Class:huge to their matching type.

Expected Behavior:
this does not grow an explicit location in Class::big or Class::huge.

Binary:
dynamic mountain raises freely

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions