Skip to content

Commit 9e8a4c9

Browse files
committed
Bug fix on address mismatch
Signed-off-by: Afonso Oliveira <[email protected]>
1 parent f7d3af6 commit 9e8a4c9

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

ext/binutils-gdb/encoding.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,13 @@ def main():
324324

325325
if success_encodings:
326326
for class_, encoding in success_encodings:
327-
if success_encodings:
328-
for class_, encoding in success_encodings:
329-
# Simulate a mismatch by modifying the encoding
330-
if True: # Always trigger the mismatch condition
331-
mismatches_found = True
332-
print(f"Error: Encoding mismatch for instruction '{name}' in YAML file '{yaml_file_path}'.")
333-
print(f" YAML match : {yaml_encoding}")
334-
print(f" Generated match: {encoding}\n")
335-
sys.exit(1) # Exit immediately on first mismatch
327+
# Actually compare the encodings
328+
if yaml_encoding.replace(" ", "") != encoding.replace(" ", ""):
329+
mismatches_found = True
330+
print(f"Error: Encoding mismatch for instruction '{name}' in YAML file '{yaml_file_path}'.")
331+
print(f" YAML match : {yaml_encoding}")
332+
print(f" Generated match: {encoding}\n")
333+
sys.exit(1) # Exit immediately on first mismatch
336334
else:
337335
# No valid definitions could be processed for this instruction
338336
print(f"Error: Could not evaluate any MATCH/MASK expressions for instruction '{name}' in YAML file '{yaml_file_path}'.\n")

0 commit comments

Comments
 (0)