Skip to content

Commit aa0574d

Browse files
sivan-shaniDhruvSrivastavaX
authored andcommitted
[utils] Fix utils/demangle_tree.py:parse_line to correctly check for closing parenthesis (llvm#142153)
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.
1 parent b98e2b4 commit aa0574d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/utils/demangle_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def parse_line(line):
2828
if open_paren == -1:
2929
return None, None
3030
close_paren = line.rfind(")", open_paren)
31-
if open_paren == -1:
31+
if close_paren == -1:
3232
return None, None
3333
mangled = line[question:open_paren]
3434
demangled = line[open_paren + 1 : close_paren]

0 commit comments

Comments
 (0)