Skip to content

Commit 9c7abbb

Browse files
committed
check_dwp_index_sections_sorted.py: only check offset, not end
1 parent 532f4e1 commit 9c7abbb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

scripts/check_dwp_index_sections_sorted.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,15 @@ def main() -> None:
7171
section_offset_table.byteswap()
7272
section_size_table.byteswap()
7373

74-
last_end = array("I", [0] * section_count)
74+
last_offset = array("I", [0] * section_count)
7575
for i in range(unit_count):
7676
for j in range(section_count):
77-
size = section_size_table[i * section_count + j]
78-
if size == 0:
77+
if section_size_table[i * section_count + j] == 0:
7978
continue
8079
offset = section_offset_table[i * section_count + j]
81-
if offset < last_end[j]:
82-
sys.exit(f"Unit {i + 1} section {j} not sorted")
83-
last_end[j] = offset + size
80+
if offset < last_offset[j]:
81+
sys.exit(f"{section_name} unit {i + 1} section {j} not sorted ({hex(offset)} < {hex(last_offset[j])})")
82+
last_offset[j] = offset
8483

8584
print("Sorted")
8685

0 commit comments

Comments
 (0)