Skip to content

Commit 2935227

Browse files
committed
Return early on error. Should fix the asan bots.
llvm-svn: 244397
1 parent cb1f601 commit 2935227

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/include/llvm/Object/ELFObjectFile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,8 @@ ELFObjectFile<ELFT>::ELFObjectFile(MemoryBufferRef Object, std::error_code &EC)
737737
getELFType(ELFT::TargetEndianness == support::little, ELFT::Is64Bits),
738738
Object),
739739
EF(Data.getBuffer(), EC) {
740+
if (EC)
741+
return;
740742
for (const Elf_Shdr &Sec : EF.sections()) {
741743
switch (Sec.sh_type) {
742744
case ELF::SHT_DYNSYM: {

0 commit comments

Comments
 (0)