mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 13:35:38 +08:00
[llvm-jitlink] Avoid assertion failure in make_error parameter
If GOTSym is not defined, we cannot call `GOTSym.getBlock()`. It failed with: ``` Assertion failed: (Base->isDefined() && "Not a defined symbol"), function getBlock, file JITLink.h, line 554. ```
This commit is contained in:
@@ -55,7 +55,11 @@ static Expected<Symbol &> getELFStubTarget(LinkGraph &G, Block &B) {
|
||||
if (!E)
|
||||
return E.takeError();
|
||||
auto &GOTSym = E->getTarget();
|
||||
if (!GOTSym.isDefined() || !isELFGOTSection(GOTSym.getBlock().getSection()))
|
||||
if (!GOTSym.isDefined())
|
||||
return make_error<StringError>("Stubs entry in " + G.getName() +
|
||||
" does not point to GOT entry",
|
||||
inconvertibleErrorCode());
|
||||
if (!isELFGOTSection(GOTSym.getBlock().getSection()))
|
||||
return make_error<StringError>(
|
||||
"Stubs entry in " + G.getName() + ", \"" +
|
||||
GOTSym.getBlock().getSection().getName() +
|
||||
|
||||
Reference in New Issue
Block a user