Skip to content

m68kemu: represent datatype objects as BOOPSI stand-ins - #2443

Open
kaffeine1 wants to merge 2 commits into
aros-development-team:masterfrom
kaffeine1:m68kemu/datatype-objects
Open

kaffeine1 wants to merge 2 commits into
aros-development-team:masterfrom
kaffeine1:m68kemu/datatype-objects

Conversation

@kaffeine1

Copy link
Copy Markdown
Contributor

Give 68k callers a BOOPSI stand-in from NewDTObjectA() and release it after DisposeDTObject(). Distinguish file names from numeric clipboard units, and allow native creation modes that supply a handle or have no file source.

The host fixture passed 13 checks with and without ASan and UBSan, including clipboard unit zero, nameless sources, invalid filename handling, and disposal. Picture attributes and layout are a separate follow-up.

@Kalamatee

Copy link
Copy Markdown
Member

The new NewDTObjectA thunk never calls boopsi_init(). Until that has run, the stand-in's class pointer stays at 0, which breaks any program whose first BOOPSI call is NewDTObject() (a typical picture viewer).

  • Calls through datatypes.library and intuition still work.
  • A DoMethod(o, ...) from the program's own code reads the dispatcher address from address 8 and jumps there.
  • The test doesn't catch it because it sets boopsi_base by hand.

Fix: call boopsi_init() at the start of the thunk, and let the test start with boopsi_base at 0.

Nit: unlike NewObjectA, this path doesn't fill in the object's Gadget fields (sync_gadget()), so a program reads them as zero.

@kaffeine1

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Updated in 7e3d8e73: NewDTObjectA() now initializes BOOPSI on first use and synchronizes the Gadget fields after creating the stand-in. The regression starts with boopsi_base == 0 and passes with ASan/UBSan. All GitHub checks, including Codacy, passed.

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

Successfully merging this pull request may close these issues.

2 participants