Bitfield ivars in Objective-C are cursed.
@david_chisnall Long ago there was an obscure bug if a superclass ended with a bitfield and its subclass started with a bitfield. (Internally the compiler smashed all ivars together into a single struct representation, then C’s bitfield coalescing rules made a mess of it.)
Fixing this bug was when I learned about C `int:0` bitfield syntax.
Yup, the interaction between non-fragile ivars and bitfields is terrifying. I’ve fixed a libobjc2 bug that, in some rare cases, made the bitfield ivars overlap non-bitfield ones, but it now ends up adding some padding where it doesn’t need to. I probably have to add a couple of flags in the ivar metadata flag to fix it.
@david_chisnall Having had the misfortune of reading a lot of Objective-C while debugging WebRTC related problems, I'm now of the opinion that the whole thing is haunted.