From 6fe2e9a9cc87cd938aeaa7d76065d22d0ad87706 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Mon, 27 Sep 2021 15:25:30 -0700 Subject: [ORC] Hold shared_ptr in errors containing SymbolStringPtrs. This allows these error values to remain valid, even if they tear down the JIT itself. --- llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp') diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp index c663f5c..40d4f19 100644 --- a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp +++ b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp @@ -279,8 +279,9 @@ public: // If there were missing symbols then report the error. if (!MissingSymbols.empty()) - return make_error(G.getName(), - std::move(MissingSymbols)); + return make_error( + Layer.getExecutionSession().getSymbolStringPool(), G.getName(), + std::move(MissingSymbols)); // If there are more definitions than expected, add them to the // ExtraSymbols vector. @@ -293,8 +294,9 @@ public: // If there were extra definitions then report the error. if (!ExtraSymbols.empty()) - return make_error(G.getName(), - std::move(ExtraSymbols)); + return make_error( + Layer.getExecutionSession().getSymbolStringPool(), G.getName(), + std::move(ExtraSymbols)); } if (auto Err = MR->notifyResolved(InternedResult)) -- cgit v1.1