summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/IRObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/IRObjectFile.cpp')
-rw-r--r--llvm/lib/Object/IRObjectFile.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
index 5001ac336be..d157908a856 100644
--- a/llvm/lib/Object/IRObjectFile.cpp
+++ b/llvm/lib/Object/IRObjectFile.cpp
@@ -78,6 +78,8 @@ IRObjectFile::findBitcodeInObject(const ObjectFile &Obj) {
StringRef SecContents;
if (std::error_code EC = Sec.getContents(SecContents))
return errorCodeToError(EC);
+ if (SecContents.size() <= 1)
+ return errorCodeToError(object_error::bitcode_section_not_found);
return MemoryBufferRef(SecContents, Obj.getFileName());
}
}
OpenPOWER on IntegriCloud