diff options
author | Greg Clayton <clayborg@gmail.com> | 2019-05-08 22:03:22 +0000 |
---|---|---|
committer | Greg Clayton <clayborg@gmail.com> | 2019-05-08 22:03:22 +0000 |
commit | 5f8e88cd69417cec63657ba16642c674e442f7b5 (patch) | |
tree | d0d3ebf309c2c4484b8ebff67a4bf8435e268c42 /lldb/source/Utility/ArchSpec.cpp | |
parent | 55fab1ff4806ed989086e4ced18a9611ec963a93 (diff) | |
download | bcm5719-llvm-5f8e88cd69417cec63657ba16642c674e442f7b5.tar.gz bcm5719-llvm-5f8e88cd69417cec63657ba16642c674e442f7b5.zip |
Fix bug in ArchSpec::MergeFrom
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.
Differential Revision: https://reviews.llvm.org/D61659
llvm-svn: 360292
Diffstat (limited to 'lldb/source/Utility/ArchSpec.cpp')
-rw-r--r-- | lldb/source/Utility/ArchSpec.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Utility/ArchSpec.cpp b/lldb/source/Utility/ArchSpec.cpp index acd677b332d..eefb4d56e86 100644 --- a/lldb/source/Utility/ArchSpec.cpp +++ b/lldb/source/Utility/ArchSpec.cpp @@ -859,7 +859,7 @@ bool ArchSpec::ContainsOnlyArch(const llvm::Triple &normalized_triple) { void ArchSpec::MergeFrom(const ArchSpec &other) { if (!TripleVendorWasSpecified() && other.TripleVendorWasSpecified()) GetTriple().setVendor(other.GetTriple().getVendor()); - if (!TripleOSWasSpecified() && other.TripleVendorWasSpecified()) + if (!TripleOSWasSpecified() && other.TripleOSWasSpecified()) GetTriple().setOS(other.GetTriple().getOS()); if (GetTriple().getArch() == llvm::Triple::UnknownArch) { GetTriple().setArch(other.GetTriple().getArch()); |