OSDN Git Service

[ORC] Reset AsynchronousSymbolQuery's NotifySymbolsResolved callback on error.
authorLang Hames <lhames@gmail.com>
Tue, 26 Jun 2018 20:59:50 +0000 (20:59 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 26 Jun 2018 20:59:50 +0000 (20:59 +0000)
AsynchronousSymbolQuery::canStillFail checks the value of the callback to
prevent sending it redundant error notifications, so we need to reset it after
running it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335664 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/Orc/Core.cpp

index 5d28c88..53e4a85 100644 (file)
@@ -196,13 +196,14 @@ void AsynchronousSymbolQuery::handleFailed(Error Err) {
   assert(QueryRegistrations.empty() && ResolvedSymbols.empty() &&
          NotYetResolvedCount == 0 && NotYetReadyCount == 0 &&
          "Query should already have been abandoned");
-  if (NotifySymbolsResolved)
+  if (NotifySymbolsResolved) {
     NotifySymbolsResolved(std::move(Err));
-  else {
+    NotifySymbolsResolved = SymbolsResolvedCallback();
+  } else {
     assert(NotifySymbolsReady && "Failed after both callbacks issued?");
     NotifySymbolsReady(std::move(Err));
-    NotifySymbolsReady = SymbolsReadyCallback();
   }
+  NotifySymbolsReady = SymbolsReadyCallback();
 }
 
 void AsynchronousSymbolQuery::addQueryDependence(VSO &V, SymbolStringPtr Name) {