fix crash

fix segfault by checking for UnknownArch, since
getArchTypePrefix() will return nullptr for UnknownArch.

This fixes regression caused by r238424.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239456 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexei Starovoitov 2015-06-10 03:06:06 +00:00
parent f095095d4a
commit e11157c668

View File

@ -519,7 +519,8 @@ void RuntimeDyldELF::resolveMIPSRelocation(const SectionEntry &Section,
}
void RuntimeDyldELF::setMipsABI(const ObjectFile &Obj) {
if (!StringRef(Triple::getArchTypePrefix(Arch)).equals("mips")) {
if (Arch == Triple::UnknownArch ||
!StringRef(Triple::getArchTypePrefix(Arch)).equals("mips")) {
IsMipsO32ABI = false;
IsMipsN64ABI = false;
return;