Skip to content

ObjC++: out-of-line C++ member definitions (Cls::M, ctor, dtor) are units (Part of #5639) - #5691

Merged
squid-protocol merged 2 commits into
mainfrom
churn/5639-objcxx-member-units
Oct 20, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
churn/5639-objcxx-member-units

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5639. Follow-up to #5689 (the issue stays open).

Cross-repo: none (no corpus or pin change).

What

gzdoom's remaining Objective-C call misses were not call-pattern bugs: in .mm files an out-of-line C++ member definition (bool Cls::Method() {, constructor Cls::Cls() with or without an initializer list, destructor Cls::~Cls()) was not a func_start match, so the previous unit's extent swallowed those bodies and their message sends were attributed to no unit (or the wrong one). func_start's C-style alternative now accepts a Scope:: qualifier (names the last component, ~Cls for a destructor) and a bare qualified ctor/dtor with no return type. A qualified call statement (Cls::Helper(1);) and a prototype still start no unit (the existing bodyless-; rejection).

Changes (3 hand-written files)

  • languages/objectivec.py: func_start C-style alternative.
  • test_objc_cxx_member_units_5639.py (new): six header shapes, attribution after a class body, call-statement/prototype negatives, ReDoS.

Class table (unit-extent class: ObjC++ constructs the C-style rule could not see)

Shape Status
T Cls::M(), ns::Cls::M(), multi-line params handled
ctor Cls::Cls(), ctor with init list, dtor Cls::~Cls() handled
Cls::f(x); statement, T Cls::f(); prototype not a unit (tested)
in-class inline methods (static CocoaWindow* GetWindow() {} inside class) already units (matched as plain C functions)
receiver as call qualifier not done (see Remaining slices)

Evidence

doom-study oracle (callcheck_all.py logic, objective-c row) on this branch's scan of gzdoom's 10 Objective-C/++ files:

units oracle calls recall precision
before 155 77 0.896 0.896
after 213 124 0.992 0.925

Remaining miss: I_InitGraphics -> UseHiDPI (SystemBaseFrameBuffer::UseHiDPI( qualified static call; the callee unit is a different shape). Engine-only edges are ] init nested sends the oracle regex cannot see, and the destructor ~Cls -> Cls (a destructor naming its own class; oracle strips it).

Gates: pr_gates --fast 6/6; --ratchets 8 pass / 0 fail / 0 skipped; tree-wide guards 184 passed. Golden masters (both legs, golden-lock.sh crucible_check.py --update --yes): no drift (the crucible corpus has no ObjC++ member definitions).

Remaining slices

  • Receiver as qualifier for message sends: objc calls_out is in the non-qualified family; _call_qualifier walks backward over ./->/::, which does not fit [recv sel]. Needs a bracket-aware qualifier path in detector.py plus a decision on how qualified edges resolve (a wrong qualifier could narrow resolved edges), measured on the doom ports. Files: detector.py, _shared_patterns.py/objc rule flag, tests.
  • Keyword selector after a call receiver [f(x) a:1].

Sibling gaps

🤖 Generated with Claude Code

squid-protocol and others added 2 commits October 19, 2026 23:12
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 20, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 20, 2026 03:29
@squid-protocol
squid-protocol enabled auto-merge (squash) October 20, 2026 03:30
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 1d1adb1 into main Oct 20, 2026
98 checks passed
@squid-protocol
squid-protocol deleted the churn/5639-objcxx-member-units branch October 20, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant