Skip to content

Commit ee8b656

Browse files
committed
Fix main #loc storage key conflict
Change main #loc storage key from "1" to "" (empty string) to avoid collision with #loc1. This resolves the issue where #loc1 would overwrite the main #loc entry when both exist in the IR file. The main #loc directive appears as `#loc = loc(...)` without a number, while numbered directives appear as `#loc1 = loc(...)`, `#loc2 = loc(...)`, etc. Using "" as the key for the main directive prevents conflicts.
1 parent 8a1e7d3 commit ee8b656

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tritonparse/ir_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def extract_loc_definitions(ir_content: str) -> Dict[str, Dict[str, Any]]:
5252
# The first #loc directive is a special case. It locates at the top of the IR files
5353
main_match = re.search(r'#loc = loc\("([^"]+)":(\d+):(\d+)\)', ir_content)
5454
if main_match:
55-
locations["1"] = {
55+
locations[""] = {
5656
"file": main_match.group(1),
5757
"line": int(main_match.group(2)),
5858
"column": int(main_match.group(3)),

0 commit comments

Comments
 (0)