This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump,ARM] Fix .byte directives dumping the wrong byte.
ClosedPublic

Authored by simon_tatham on Jul 22 2022, 7:18 AM.

Details

Summary

The clause in dumpARMELFData that dumps a single byte as a .byte
directive was printing the operand of that directive as Bytes[0],
not Bytes[Index]. In particular, this led to the dumpBytes output
to its left not matching it!

Diff Detail

Event Timeline

simon_tatham created this revision.Jul 22 2022, 7:18 AM
simon_tatham requested review of this revision.Jul 22 2022, 7:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2022, 7:18 AM
MaskRay added a comment.EditedJul 22 2022, 1:24 PM

Thanks for catching the ARM bug. In the test, 0 is a very common value and the test may still pass with other types of wrong-index bugs. Can you improve the test a bit?

Good point, thanks. Updated the test to contain a more distinctive value in the final byte of the data section.

This revision is now accepted and ready to land.Jul 25 2022, 4:20 AM
This revision was landed with ongoing or failed builds.Jul 25 2022, 6:56 AM
This revision was automatically updated to reflect the committed changes.