[llvm] r182542 - Missed removing one of the assert()'s from the LLVMCreateDisasmCPU() library
Kevin Enderby
enderby at apple.com
Wed May 22 17:32:34 PDT 2013
Author: enderby
Date: Wed May 22 19:32:34 2013
New Revision: 182542
URL: http://llvm.org/viewvc/llvm-project?rev=182542&view=rev
Log:
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
Modified:
llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp
Modified: llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp?rev=182542&r1=182541&r2=182542&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp (original)
+++ llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp Wed May 22 19:32:34 2013
@@ -40,7 +40,8 @@ LLVMDisasmContextRef LLVMCreateDisasmCPU
// 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)
More information about the llvm-commits
mailing list