From: Lang Hames Date: Thu, 12 Mar 2020 02:49:12 +0000 (-0700) Subject: [ORC] Fix an overly aggressive assert. X-Git-Tag: llvmorg-12-init~12349 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b19801640bf621a596187d819afb57514713d1e7;p=platform%2Fupstream%2Fllvm.git [ORC] Fix an overly aggressive assert. It is ok to add dependencies on symbols that are ready, they should just be skipped. --- diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp index ef4ab1e..49b7395 100644 --- a/llvm/lib/ExecutionEngine/Orc/Core.cpp +++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp @@ -1001,16 +1001,18 @@ void JITDylib::addDependencies(const SymbolStringPtr &Name, // Check the sym entry for the dependency. auto OtherSymI = OtherJITDylib.Symbols.find(OtherSymbol); -#ifndef NDEBUG // Assert that this symbol exists and has not reached the ready state // already. assert(OtherSymI != OtherJITDylib.Symbols.end() && - (OtherSymI->second.getState() < SymbolState::Ready && - "Dependency on emitted/ready symbol")); -#endif + "Dependency on unknown symbol"); auto &OtherSymEntry = OtherSymI->second; + // If the other symbol is already in the Ready state then there's no + // dependency to add. + if (OtherSymEntry.getState() == SymbolState::Ready) + continue; + // If the dependency is in an error state then note this and continue, // we will move this symbol to the error state below. if (OtherSymEntry.getFlags().hasError()) {