Repository navigation
Close #601: strict tests for objective-c, fix 13 real symbolic-\b bugs - #639
Merged
Merged
Conversation
Full positive/negative/ambiguity/ReDoS coverage for all 44 checklisted structural signatures objective-c defines (per epic #518's per-language scaffold). Objective-C turned out to be the single worst-hit language yet for the "\b-wrapped-symbolic-token" bug class (#585, #637): its @-directive syntax and colon-terminated selector keywords are exactly the shape that breaks under a shared \b(...)\b wrapper. 13 confirmed bugs across 11 signatures: @-directive fixes (leading \b before non-word `@` never matched real code): - branch: @try/@catch/@finally - safety: @try/@catch/@finally - structural_boundaries: @interface/@implementation/@protocol/@end/ @synthesize/@dynamic/@class/@import - concurrency: @synchronized - sync_locks: @synchronized - panics_and_aborts: @throw - encapsulation: @private/@protected/@Package - ownership: @author Trailing-colon selector fixes (trailing \b after literal `:` only worked when followed by ANOTHER non-word char -- true for a plain identifier argument, false for the equally common `@selector(...)` form): - comprehensions: enumerateObjectsUsingBlock:/filteredArrayUsingPredicate:/ makeObjectsPerformSelector: - safety_bypasses: performSelector: (also dropped the now-redundant "performSelector:withObject:" alternative -- it's an unreachable subset of "performSelector:" in left-to-right alternation) - dependency_injection: inject:/initWithDependency: - listeners: addObserver:/observeValueForKeyPath:/subscribeNext: Bracket-message fix (globals): `[UIApplication sharedApplication]` and `[NSWorkspace sharedWorkspace]` never matched -- both leading `[` and trailing `]` are non-word, so neither boundary could fire. Also confirmed (not fixed, documented as accepted): `&foo` intentionally triggers both bitwise_ops and pointers -- `&` is genuinely overloaded in C-family syntax for unary address-of and binary bitwise-AND, and disambiguating requires real parsing, not a regex fix. Golden master fixtures updated via the sanctioned tests/tools/update_golden_master.py and reviewed before blessing: all 105 diffs confined to objective-c files (Sequential Logic Declarations: 0->1, 0->2 -- real @interface/@implementation detection firing for the first time), zero signal-count collapse. Full suite (1134 tests), ruff audit, mypy audit, and both golden-crucible modes pass. Closes #601. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full positive/negative/ambiguity/ReDoS coverage for all 44 checklisted structural signatures
objective-cdefines (per epic #518's per-language scaffold). Objective-C turned out to be the single worst-hit language yet for the "\b-wrapped-symbolic-token" bug class (see #585, #637): its@-directive syntax and colon-terminated selector keywords are exactly the shape that breaks under a shared\b(...)\bwrapper. 13 confirmed bugs across 11 signatures.Bugs found and fixed
@-directive fixes (leading\bbefore non-word@never matched real code --\brequires a word/non-word transition, but@preceded by a space/line-start is non-word-to-non-word, no transition exists):branch,safety:@try/@catch/@finallystructural_boundaries:@interface/@implementation/@protocol/@end/@synthesize/@dynamic/@class/@importconcurrency,sync_locks:@synchronizedpanics_and_aborts:@throwencapsulation:@private/@protected/@packageownership:@authorTrailing-colon selector fixes (trailing
\bafter a literal:only worked when followed by ANOTHER non-word char -- true for a plain identifier argument, false for the equally common@selector(...)form):comprehensions:enumerateObjectsUsingBlock:/filteredArrayUsingPredicate:/makeObjectsPerformSelector:safety_bypasses:performSelector:(also dropped the now-redundant"performSelector:withObject:"alternative -- it's an unreachable subset of"performSelector:"in left-to-right alternation)dependency_injection:inject:/initWithDependency:listeners:addObserver:/observeValueForKeyPath:/subscribeNext:Bracket-message fix (
globals):[UIApplication sharedApplication]and[NSWorkspace sharedWorkspace]never matched -- both leading[and trailing]are non-word, so neither boundary could fire.Also confirmed (not a bug, documented as accepted)
&foointentionally triggers bothbitwise_opsandpointers--&is genuinely overloaded in C-family syntax for unary address-of and binary bitwise-AND, and disambiguating requires real parsing, not a regex fix. Added a test that locks in this current, accepted dual-classification.Golden master fixtures
Updated via the sanctioned
tests/tools/update_golden_master.py, reviewed before blessing: all 105 diffs confined to objective-c files (Sequential Logic Declarations: 0->1, 0->2-- real@interface/@implementationdetection firing for the first time), zero signal-count collapse.Test plan
pytest tests/-- 1134 passedpython tests/ruff_audit.py --ci-- cleanpython tests/mypy_audit.py --ci-- cleanpytest -m golden_crucible-- passes in both full-precision and zero-dependency modes after fixture regenerationCloses #601.
🤖 Generated with Claude Code