diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index 6b4e2d2a659..4ba8985e72a 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -615,6 +615,8 @@ namespace { bool LTOModule::addAsmGlobalSymbols(MCContext &Context, std::string &errMsg) { const std::string &inlineAsm = _module->getModuleInlineAsm(); + if (inlineAsm.empty()) + return false; OwningPtr Streamer(new RecordStreamer(Context)); MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(inlineAsm);