This is an archive of the discontinued LLVM Phabricator instance.

Fix bug in ArchSpec::MergeFrom
ClosedPublic

Authored by clayborg on May 7 2019, 2:57 PM.

Details

Summary

Previous ArchSpec tests didn't catch this bug since we never tested just the OS being out of date. Fixed the bug and covered this with a test that would catch this.

This was found when trying to load a core file where the core file was an ELF file with just the e_machine for architeture and where the ELF header had no OS set in the OSABI field of the e_ident. It wasn't merging the architecture with the target architecture correctly.

Diff Detail

Event Timeline

clayborg created this revision.May 7 2019, 2:57 PM
xiaobai added a subscriber: xiaobai.May 7 2019, 3:11 PM

Ah, this was my bad. Thanks for taking care of this.

unittests/Utility/ArchSpecTest.cpp
188–193

I think it might be a good idea to assert A's values here to show that nothing changed except the OS after the MergeFrom call.

labath accepted this revision.May 8 2019, 4:26 AM
This revision is now accepted and ready to land.May 8 2019, 4:26 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 8 2019, 3:01 PM