resym icon indicating copy to clipboard operation
resym copied to clipboard

Bitflag members are incorrectly identified as an unnamed union

Open TrinityDevelopers opened this issue 3 years ago • 2 comments

When you have more than one bitflag members, they are incorrectly identified as an unnamed union. For example:

struct bitflags {
    bool flag1 : 1;
    bool flag2 : 1;
    bool flag3 : 1;
    bool flag4 : 1;
    bool flag5 : 1;
    bool flag6 : 1;
    bool flag7 : 1;
    bool flag8 : 1;
};

Is identified as:

struct bitflags {
    union {
        bool flag1 : 1;
        bool flag2 : 1;
        bool flag3 : 1;
        bool flag4 : 1;
        bool flag5 : 1;
        bool flag6 : 1;
        bool flag7 : 1;
        bool flag8 : 1;
    };
};

TrinityDevelopers avatar Jun 21 '22 20:06 TrinityDevelopers

Hi! Yes indeed, thanks for creating an issue to track this as I forgot to do it! Bitfields are actually always put inside of a union at the moment (no need to have 8 members). I haven't taken the time to fix this as it shouldn't produce incorrect layouts.

But yes, ideally this should not happen.

ergrelet avatar Jun 22 '22 17:06 ergrelet

Yeah I only checked with this one scenario but that would make sense given the implementation. I've updated the issue to reflect.

TrinityDevelopers avatar Jun 22 '22 18:06 TrinityDevelopers

The issue should now be fixed on master!

ergrelet avatar Feb 14 '23 23:02 ergrelet