[llvm] 4fc2a4c - [ORC] Destroy FinalizeErr if there is a serialization error.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 14:24:06 PDT 2021


Author: Lang Hames
Date: 2021-10-11T14:23:50-07:00
New Revision: 4fc2a4cc013b87d240b7a8bd4109fbc58495d302

URL: https://github.com/llvm/llvm-project/commit/4fc2a4cc013b87d240b7a8bd4109fbc58495d302
DIFF: https://github.com/llvm/llvm-project/commit/4fc2a4cc013b87d240b7a8bd4109fbc58495d302.diff

LOG: [ORC] Destroy FinalizeErr if there is a serialization error.

If there is a serialization error then FinalizeErr should never be set, so we
can use cantFail rather than consumeError here.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp b/llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp
index e57f910e35cd..234c0852a013 100644
--- a/llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.cpp
@@ -63,9 +63,10 @@ class EPCGenericJITLinkMemoryManager::Alloc
         Parent.SAs.Finalize,
         [OnFinalize = std::move(OnFinalize)](Error SerializationErr,
                                              Error FinalizeErr) {
-          if (SerializationErr)
+          if (SerializationErr) {
+            cantFail(std::move(FinalizeErr));
             OnFinalize(std::move(SerializationErr));
-          else
+          } else
             OnFinalize(std::move(FinalizeErr));
         },
         Parent.SAs.Allocator, std::move(FR));


        


More information about the llvm-commits mailing list