Skip to content

Commit 123159c

Browse files
committed
Fix tools/unnamed.py
1 parent 324ae16 commit 123159c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/unnamed.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ def read_string(file):
9090
elif magic == b'RGB9':
9191
obj_ver = 10 + unpack_from('<I', file)[0]
9292

93-
if obj_ver not in [6, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22]:
93+
if obj_ver not in [6, 10, 11, 12, 13] and obj_ver < 15:
9494
print(f"Error: File '{objfile}' is of an unknown format.", file=sys.stderr)
9595
sys.exit(1)
9696

9797
num_symbols = unpack_from('<I', file)[0]
9898
unpack_from('<I', file) # skip num sections
9999

100-
if obj_ver in [16, 17, 18, 19, 20, 21, 22]:
100+
if obj_ver >= 16:
101101
node_filenames = []
102102
num_nodes = unpack_from('<I', file)[0]
103103
for x in range(num_nodes):
104104
unpack_from('<II', file) # parent id, parent line no
105-
node_type = unpack_from('<B', file)[0]
105+
node_type = unpack_from('<B', file)[0] & 0x7f
106106
if node_type:
107107
node_filenames.append(read_string(file))
108108
else:
@@ -117,7 +117,7 @@ def read_string(file):
117117
sym_type = symtype(unpack_from('<B', file)[0] & 0x7f)
118118
if sym_type == symtype.IMPORT:
119119
continue
120-
if obj_ver in [16, 17, 18, 19, 20, 21, 22]:
120+
if obj_ver >= 16:
121121
sym_fileno = unpack_from('<I', file)[0]
122122
sym_filename = node_filenames[sym_fileno]
123123
else:

0 commit comments

Comments
 (0)