From 74d52cb64917bb9eef71e6872f755c817d36d2d1 Mon Sep 17 00:00:00 2001 From: rudy Date: Tue, 7 Dec 2021 16:34:24 +0100 Subject: [PATCH] fix(clang): remove an error reported by clang --- compiler/lib/Support/CompilerEngine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/lib/Support/CompilerEngine.cpp b/compiler/lib/Support/CompilerEngine.cpp index 82874abe2..f1a7358ab 100644 --- a/compiler/lib/Support/CompilerEngine.cpp +++ b/compiler/lib/Support/CompilerEngine.cpp @@ -368,12 +368,12 @@ CompilerEngine::Library::addCompilation(CompilationResult &compilation) { auto objectPath = sourceName + OBJECT_EXT; auto error = mlir::zamalang::emitObject(*module, objectPath); - if (!error) { - addExtraObjectFilePath(objectPath); - return objectPath; + if (error) { + return std::move(error); } - return error; + addExtraObjectFilePath(objectPath); + return objectPath; } bool stringEndsWith(std::string path, std::string requiredExt) {