Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jiangzhengwenjz opened this issue Mar 5, 2022 · 0 comments
Open

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

jiangzhengwenjz opened this issue Mar 5, 2022 · 0 comments

Comments

@jiangzhengwenjz
Copy link
Owner

jiangzhengwenjz commented Mar 5, 2022

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.

@jiangzhengwenjz jiangzhengwenjz changed the title TODO: confirm that struct Kirby is not a union TODO: confirm that struct Kirby doesn't contain a union Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant