fix(cpp): raise func_start's constructor initializer-list cap from 500 to 2000 chars - #2274
Merged
Conversation
…0 to 2000 chars The cpp func_start regex's member-initializer-list clause for constructors capped the span at 500 characters before requiring the body's opening brace. A real constructor with a long initializer list (many member fields) exceeds this cap, so the regex never reaches the brace and the WHOLE constructor is missed -- not degraded, entirely invisible. Widened the cap to 2000 chars -- still a single bounded negated- character-class repetition, no unbounded quantifiers, consistent with the existing "IRON WALL" ReDoS-avoidance comment. Confirmed via timing probe: sub-millisecond at 2000/4000/8000-char filler inputs, scaling ~1.2x rather than the ~4x that would signal O(n^2) backtracking. Confirmed on language-crucible's mlir/flatbuffer_export.cc: the Translator class constructor (906-char initializer-list span) is now found. Closes #2009 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…t-cap # Conflicts: # tests/golden_master_audit.json # tests/golden_master_zero_dep_audit.json
squid-protocol
enabled auto-merge (squash)
August 26, 2026 15:14
…t-cap # Conflicts: # gitgalaxy/standards/language_standards.py # tests/tree_sitter_accuracy_baseline_cpp.json
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
Fixes #2009.
func_start's member-initializer-list clause for constructors capped the span at 500 characters before requiring the body's opening brace. A real constructor with a long initializer list (many member fields) exceeds this cap, so the regex never reaches the brace and the WHOLE constructor is missed -- not degraded, entirely invisible.Fix
Widened the cap from
{0,500}to{0,2000}-- still a single bounded negated-character-class repetition, no unbounded quantifiers, consistent with the existing "IRON WALL" ReDoS-avoidance comment.Evidence
language-crucible/data/cpp/mlir/flatbuffer_export.cc: theTranslatorclass constructor (906-char initializer-list span) is now found.Verification
pytest tests/extraction/languages/test_cpp.py tests/extraction/languages/test_cpp_strict.py -q-- 126 passed (1 new positive case, 1 new ReDoS timing probe added to the existing sweep)audit_check.py --ci-- cleancrucible_check.py --mode both-- drift confined to cpp/mlir (Function Analysis change forflatbuffer_export.cc, attributable) plus expected global coordinate ripple, blessedtree_sitter_accuracy_audit.py --lang cpp --ci-- clean, no naming-format issues🤖 Generated with Gemini (via
agy), orchestrated and independently verified by Claude Code.