diff --git a/lib/Object/MachOUniversal.cpp b/lib/Object/MachOUniversal.cpp index 1d0e69e4622..a1c83b9b7f8 100644 --- a/lib/Object/MachOUniversal.cpp +++ b/lib/Object/MachOUniversal.cpp @@ -69,14 +69,14 @@ MachOUniversalBinary::ObjectForArch::ObjectForArch( ErrorOr> MachOUniversalBinary::ObjectForArch::getAsObjectFile() const { - if (Parent) { - StringRef ParentData = Parent->getData(); - StringRef ObjectData = ParentData.substr(Header.offset, Header.size); - StringRef ObjectName = Parent->getFileName(); - MemoryBufferRef ObjBuffer(ObjectData, ObjectName); - return ObjectFile::createMachOObjectFile(ObjBuffer); - } - return object_error::parse_failed; + if (!Parent) + return object_error::parse_failed; + + StringRef ParentData = Parent->getData(); + StringRef ObjectData = ParentData.substr(Header.offset, Header.size); + StringRef ObjectName = Parent->getFileName(); + MemoryBufferRef ObjBuffer(ObjectData, ObjectName); + return ObjectFile::createMachOObjectFile(ObjBuffer); } ErrorOr>