You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unbounded signature search for C++ causes hallucinated argument counts #1836
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: mediumtestingUnit, integration, and E2E pipeline verification
name: Unbounded signature search for C++ causes hallucinated argument counts
Description
In gitgalaxy/core/detector.py, the _slice_by_braces method bounds the argument signature search for C (args_sig_end = brace_idx) but fails to do so for C++ (cpp). Because args_sig_end is left as None for C++, args_search_text becomes None in _calculate_block_metrics, causing the args_pattern.search() call to scan the entire function body instead of just the signature.
When a C++ function has an empty parameter list (e.g., void inProcess_initialize()), the strict args regex fails to match the signature because it requires at least one typed parameter. The regex then continues scanning the function body and incorrectly matches function calls (such as RegisterWindowMessage(...)), extracting argument counts from those internal calls rather than the actual function signature.
Impact
This leads to args_exact_match being significantly lower than args_comparable for C++ in the accuracy audits, as functions with 0 arguments are frequently recorded as having 1 or 2 arguments due to internal function calls being falsely identified as signatures.
Example
godot/editor_node.cpp::EditorNode::save_before_run (0 arguments) incorrectly reports args_count=2 because it matches an internal method call. Similarly, NVDA/inProcess.cpp::inProcess_initialize incorrectly reports args_count=1.
Proposed Fix
In _slice_by_braces (around line 2951), update the condition to include cpp (and potentially objective-c):
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: mediumtestingUnit, integration, and E2E pipeline verification
Activity
Correct overclaim in c.md, cross-reference pre-existing args issues, …