Skip to content

TODO: confirm that struct Kirby doesn't contain a union #100

@jiangzhengwenjz

Description

@jiangzhengwenjz

I think struct Kirby doesn't contain a union. Basically, it has to be a union if ObjectBase::kirby1 is really of type struct Kirby *, but actually it's likely capable of pointing to different types based on struct ObjectBase (and, it really makes no sense to make the field a union as it's accessed everywhere).

src/bonus.c:298:    obj->base.kirby1 = arg0;
src/object.c:1179:        r4->base.kirby1 = r7->base.base.base.parent; // unknown type
src/object.c:1281:    r12->base.kirby1 = r4->base.base.base.parent; // unknown type
src/blockin.c:41:        arg0->base.kirby1 = sub_0803D368(&arg0->base); // It really returns `struct Kirby *` here. 

Fixing the type is easy so I will wait until more code is decompiled to get it more evident.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions