Skip to content

Commit 8682166

Browse files
authored
[test] Parse start hex offset when extracting WAT address in test_dwarf (#27455)
WebAssembly/binaryen#8944 changed WAT code offset annotations from single addresses `;; code offset: 0x8` to address ranges `;; code offset: 0x8 - 0xa`. Extracting `.split()[0]` works with both single addresses and address ranges.
1 parent 1754f78 commit 8682166

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8164,7 +8164,7 @@ def get_wat_addr(call_index):
81648164
start_addr_loc = wat.find('0x', call_loc)
81658165
assert start_addr_loc > 0
81668166
start_addr_loc_end = wat.find('\n', start_addr_loc)
8167-
start_addr = int(wat[start_addr_loc:start_addr_loc_end], 0)
8167+
start_addr = int(wat[start_addr_loc:start_addr_loc_end].split()[0], 0)
81688168
# the call ends with the drop, which is the last in the stream, at the
81698169
# highest address
81708170
end_addr_loc = wat.rfind('drop', 0, call_loc)
@@ -8173,7 +8173,7 @@ def get_wat_addr(call_index):
81738173
assert end_addr_loc > 0
81748174
end_addr_loc_end = wat.find('\n', end_addr_loc)
81758175
assert end_addr_loc_end > 0
8176-
end_addr = int(wat[end_addr_loc:end_addr_loc_end], 0)
8176+
end_addr = int(wat[end_addr_loc:end_addr_loc_end].split()[0], 0)
81778177
return (start_addr, end_addr)
81788178

81798179
# match up the DWARF and the wat

0 commit comments

Comments
 (0)