Discussion
Loading...

Discussion

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
David Chisnall (*Now with 50% more sarcasm!*)
David Chisnall (*Now with 50% more sarcasm!*)
@david_chisnall@infosec.exchange  ·  activity timestamp 2 months ago

Bitfield ivars in Objective-C are cursed.

  • Copy link
  • Flag this post
  • Block
Federation Bot
Federation Bot
@Federation_Bot replied  ·  activity timestamp 2 months ago

@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.

  • Copy link
  • Flag this comment
  • Block
David Chisnall (*Now with 50% more sarcasm!*)
David Chisnall (*Now with 50% more sarcasm!*)
@david_chisnall@infosec.exchange replied  ·  activity timestamp 2 months ago

@gparker

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.

  • Copy link
  • Flag this comment
  • Block
Harsh Shandilya
Harsh Shandilya
@msfjarvis@androiddev.social replied  ·  activity timestamp 2 months ago

@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.

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.7 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct