[GH-ISSUE #156] Objective-C class discovery includes non-class _OBJC_ symbols #104

Closed
opened 2026-10-15 18:21:12 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @morluto on GitHub (Jul 14, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/156

Symptom

discoverObjcClasses is documented as discovering Objective-C class labels, but the current filter accepts any symbol name starting with _OBJC_ in addition to class markers.

Evidence

  • Symbol filter logic in src/domain/symbolAnalysis.ts matches:
    • explicit class markers OBJC_CLASS / OBJC_$_CLASS
    • any symbol that startsWith("_OBJC_")
  • The broad second predicate can include ivar/meta/protocol-related symbols that are not class declarations.

Why this is likely a bug

The function contract implies class-only discovery, but the current rule can return mixed symbol families in noisy or misleading output.

Reproduction idea

Feed symbol names containing mixed _OBJC_ symbols, for example:

  • _OBJC_IVAR_$_Foo
  • _OBJC_METACLASS_$_Foo
  • _OBJC_PROP_$_Foo
  • _OBJC_CLASS_$_RealClass

Observed behavior is that all of these can be returned by class discovery when no additional guards are applied.

Expected behavior

Restrict class discovery to class-specific mangling/mask patterns (or add a separate opt-in path for broader _OBJC_ symbol families), so users querying class symbols do not get non-class matches.

Originally created by @morluto on GitHub (Jul 14, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/156 ## Symptom `discoverObjcClasses` is documented as discovering Objective-C class labels, but the current filter accepts any symbol name starting with `_OBJC_` in addition to class markers. ## Evidence - Symbol filter logic in `src/domain/symbolAnalysis.ts` matches: - explicit class markers `OBJC_CLASS` / `OBJC_$_CLASS` - any symbol that `startsWith("_OBJC_")` - The broad second predicate can include ivar/meta/protocol-related symbols that are not class declarations. ## Why this is likely a bug The function contract implies class-only discovery, but the current rule can return mixed symbol families in noisy or misleading output. ## Reproduction idea Feed symbol names containing mixed `_OBJC_` symbols, for example: - `_OBJC_IVAR_$_Foo` - `_OBJC_METACLASS_$_Foo` - `_OBJC_PROP_$_Foo` - `_OBJC_CLASS_$_RealClass` Observed behavior is that all of these can be returned by class discovery when no additional guards are applied. ## Expected behavior Restrict class discovery to class-specific mangling/mask patterns (or add a separate opt-in path for broader `_OBJC_` symbol families), so users querying class symbols do not get non-class matches.
bsakaguchi 2026-10-15 18:21:12 +00:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#104
No description provided.