katam icon indicating copy to clipboard operation
katam copied to clipboard

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

Open jiangzhengwenjz opened this issue 2 years ago • 0 comments

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 avatar Mar 05 '22 06:03 jiangzhengwenjz