diff options
author | Kevin Enderby <enderby@apple.com> | 2013-05-23 00:32:34 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2013-05-23 00:32:34 +0000 |
commit | b737702efd96d2902c7063152747e8f193aa1fbc (patch) | |
tree | 9eb83ab6c6f5fa7b78c060741213f9dbab457da8 /lib/MC/MCDisassembler | |
parent | 549221f18c8248cd5daa8967ba999b91b1fe2584 (diff) | |
download | external_llvm-b737702efd96d2902c7063152747e8f193aa1fbc.zip external_llvm-b737702efd96d2902c7063152747e8f193aa1fbc.tar.gz external_llvm-b737702efd96d2902c7063152747e8f193aa1fbc.tar.bz2 |
Missed removing one of the assert()'s from the LLVMCreateDisasmCPU() library
API with my 176880 revision. If a bad Triple is passed in it can also assert.
In this case too it should just return 0 to indicate failure to create the
disassembler.
rdar://13955214
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDisassembler')
-rw-r--r-- | lib/MC/MCDisassembler/Disassembler.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MC/MCDisassembler/Disassembler.cpp b/lib/MC/MCDisassembler/Disassembler.cpp index d3c0192..c80a167 100644 --- a/lib/MC/MCDisassembler/Disassembler.cpp +++ b/lib/MC/MCDisassembler/Disassembler.cpp @@ -40,7 +40,8 @@ LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU, // Get the target. std::string Error; const Target *TheTarget = TargetRegistry::lookupTarget(Triple, Error); - assert(TheTarget && "Unable to create target!"); + if (!TheTarget) + return 0; const MCRegisterInfo *MRI = TheTarget->createMCRegInfo(Triple); if (!MRI) |