Skip to content

[utils] Fix utils/demangle_tree.py:parse_line to correctly check for closing parenthesis #142153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

sivan-shani
Copy link
Contributor

@sivan-shani sivan-shani commented May 30, 2025

Previously, parse_line incorrectly repeated the check for open_paren instead of verifying the presence of a closing parenthesis. This caused inputs with an unmatched opening parenthesis to be parsed incorrectly.

For example:
print(parse_line('?foo (bar'))
→ before: ('?foo', 'ba') [incorrect]
→ after: (None, None) [correct]

Fixed the condition to properly check close_paren.

… for closing parenthesis

Previously, parse_line incorrectly repeated the check for open_paren
instead of verifying the presence of a closing parenthesis. This caused
inputs with an unmatched opening parenthesis to be parsed incorrectly.

For example:
    print(parse_line('?foo (bar'))
    → before: ('?foo', 'ba')   [incorrect]
    → after:  (None, None)     [correct]

Fixed the condition to properly check close_paren.
@sivan-shani sivan-shani changed the title [utils] Fix llvm/utils/demangle_tree.py:parse_line to correctly check… [utils] Fix utils/demangle_tree.py:parse_line to correctly chek for closing parenthesis May 30, 2025
@sivan-shani sivan-shani requested a review from tru May 30, 2025 14:16
@sivan-shani sivan-shani marked this pull request as ready for review May 30, 2025 14:25
@sivan-shani sivan-shani requested review from zjturner and removed request for zjturner and tru June 2, 2025 08:50
Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chek > check in the title.

Otherwise LGTM

@davemgreen davemgreen requested review from tru and zjturner June 2, 2025 09:05
@sivan-shani sivan-shani changed the title [utils] Fix utils/demangle_tree.py:parse_line to correctly chek for closing parenthesis [utils] Fix utils/demangle_tree.py:parse_line to correctly check for closing parenthesis Jun 2, 2025
@sivan-shani sivan-shani merged commit 30ce1aa into llvm:main Jun 2, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants