diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp index 276857016baa..66be77173983 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp @@ -790,10 +790,7 @@ bool MachOYamlIOTaggedDocumentHandler::handledDocTag(llvm::yaml::IO &io, return false; } info->_normalizeMachOFile = nullptr; - - // Transfer ownership to "out" File parameter. - std::unique_ptr f = std::move(*fileOrError); - file = f.release(); + file = fileOrError->release(); return true; }