summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-06-12 20:43:17 +0000
committerLang Hames <lhames@gmail.com>2018-06-12 20:43:17 +0000
commit22a7440200a7eb23f784a5da3dbf6595acb204a1 (patch)
tree59659994d562621a9eb33c8e6e6fff496fd9def0 /llvm/lib/ExecutionEngine/RuntimeDyld
parente7989ef47fa233e1fac2d76a23fec021db69fd23 (diff)
downloadbcm5719-llvm-22a7440200a7eb23f784a5da3dbf6595acb204a1.tar.gz
bcm5719-llvm-22a7440200a7eb23f784a5da3dbf6595acb204a1.zip
[RuntimeDyld] Add an assert to catch misbehaving symbol resolvers.
Resolvers are required to find results for all requested symbols or return an error, but if a resolver fails to adhere to this contract (by returning results for only a subset of the requested symbols) then this code will infinite loop. This assertion catches resolvers that fail to adhere to the contract. llvm-svn: 334536
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index d3ac4f145c8..1189be599ed 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -1017,6 +1017,9 @@ Error RuntimeDyldImpl::resolveExternalSymbols() {
if (!NewResolverResults)
return NewResolverResults.takeError();
+ assert(NewResolverResults->size() == NewSymbols.size() &&
+ "Should have errored on unresolved symbols");
+
for (auto &RRKV : *NewResolverResults) {
assert(!ResolvedSymbols.count(RRKV.first) && "Redundant resolution?");
ExternalSymbolMap.insert(RRKV);
OpenPOWER on IntegriCloud