Skip to content

Fix Objective-C ARC assertions and add standalone ownership regressions - #3

Merged
KitsuneSemCalda merged 1 commit into
mainfrom
codex/fix-objc-arc-support
Oct 30, 2026
Merged

KitsuneSemCalda merged 1 commit into
mainfrom
codex/fix-objc-arc-support

Conversation

@KitsuneSemCalda

Copy link
Copy Markdown
Owner

Including cest.h in an ARC Objective-C translation unit fails before any assertion runs: the value union contains a strong id, and the diagnostic/equality paths cast Objective-C objects to C pointers without an ARC bridge. A standalone reproducer confirms this without any FoxStep headers or implementation. libobjc2's unsigned-char BOOL also falls through the C _Generic mapping to the pointer wrapper.

Make assertion object values explicit synchronous borrows, bridge object-to-pointer conversions only under ARC, handle signed/unsigned char scalars, and preserve caller-provided feature-test macros. Add a runtime-only regression fixture and tests for nil, BOOL, object/pointer comparison, deallocation after the last assertion, and deliberately failing assertion diagnostics. Add the four Objective-C/Objective-C++ ARC/MRC combinations to macOS CI.

Validation performed locally on Linux x86_64 with Clang 23 and libobjc2 a21ae931e4c186312701d7a4a8e85204955965a6:

  • The standalone ARC reproducer fails to compile against the original header.
  • All four language/ownership combinations pass against this change; negative controls return status 1 and print the object diagnostic.
  • The same four combinations pass with ASan/UBSan/LeakSanitizer enabled.
  • Existing C/C++ examples pass with GCC 16 and Clang 23.

Apple CI is configured by this PR and has not been run locally. The separate weak-variable declaration error found in the FoxStep test belongs to that test and is not included here.

@KitsuneSemCalda
KitsuneSemCalda merged commit 1533b2c into main Oct 30, 2026
7 checks passed
@KitsuneSemCalda
KitsuneSemCalda deleted the codex/fix-objc-arc-support branch November 1, 2026 14:18
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.

1 participant