forked from OSchip/llvm-project
[LTO] Return proper error object rather than null LTOModule
This caused a crash in LTOModule::createInLocalContext. rdar://37926841 llvm-svn: 327359
This commit is contained in:
parent
7646e77969
commit
ade40dd3c8
|
@ -208,7 +208,7 @@ LTOModule::makeLTOModule(MemoryBufferRef Buffer, const TargetOptions &options,
|
|||
std::string errMsg;
|
||||
const Target *march = TargetRegistry::lookupTarget(TripleStr, errMsg);
|
||||
if (!march)
|
||||
return std::unique_ptr<LTOModule>(nullptr);
|
||||
return make_error_code(object::object_error::arch_not_found);
|
||||
|
||||
// construct LTOModule, hand over ownership of module and target
|
||||
SubtargetFeatures Features;
|
||||
|
|
Loading…
Reference in New Issue