Skip to content

Commit

Permalink
discard Error's
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Jan 5, 2021
1 parent 165fe64 commit c318d42
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,13 +808,21 @@ JL_JITSymbol JuliaOJIT::findUnmangledSymbol(StringRef Name)
uint64_t JuliaOJIT::getGlobalValueAddress(StringRef Name)
{
auto addr = findSymbol(getMangledName(Name), false);
return addr ? cantFail(addr.getAddress()) : 0;
if (Error Err = addr.takeError()) {
handleAllErrors(std::move(Err), [](ErrorInfoBase &EIB) {}); // handle Error for assertions
return 0;
}
return cantFail(addr.getAddress());
}

uint64_t JuliaOJIT::getFunctionAddress(StringRef Name)
{
auto addr = findSymbol(getMangledName(Name), false);
return addr ? cantFail(addr.getAddress()) : 0;
if (Error Err = addr.takeError()) {
handleAllErrors(std::move(Err), [](ErrorInfoBase &EIB) {}); // handle Error for assertions
return 0;
}
return cantFail(addr.getAddress());
}

static int globalUniqueGeneratedNames;
Expand Down

0 comments on commit c318d42

Please sign in to comment.