Skip to content

Commit

Permalink
Fix assert crash from the error from getSymbolName CoffObj export_dir…
Browse files Browse the repository at this point in the history
…ectory iterator in Dyld::BuildBloomFilter
  • Loading branch information
fsfod committed Feb 5, 2024
1 parent c42fab9 commit 8d527a5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/Interpreter/DynamicLibraryManagerSymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,17 @@ namespace Cpp {
// All the symbols are already flagged as exported.
// We cannot really ignore symbols based on flags as we do on unix.
StringRef Name;
if (I->getSymbolName(Name))
auto Err = I->getSymbolName(Name);

Check warning on line 914 in lib/Interpreter/DynamicLibraryManagerSymbol.cpp

View check run for this annotation

Codecov / codecov/patch

lib/Interpreter/DynamicLibraryManagerSymbol.cpp#L914

Added line #L914 was not covered by tests

if (Err) {
std::string Message;
handleAllErrors(std::move(Err), [&](llvm::ErrorInfoBase& EIB) {
Message += EIB.message() + "; ";
});
LLVM_DEBUG(dbgs() << "Dyld::BuildBloomFilter: Failed to read symbol "

Check warning on line 921 in lib/Interpreter/DynamicLibraryManagerSymbol.cpp

View check run for this annotation

Codecov / codecov/patch

lib/Interpreter/DynamicLibraryManagerSymbol.cpp#L916-L921

Added lines #L916 - L921 were not covered by tests
<< Message << "\n");
continue;
}

Check warning on line 924 in lib/Interpreter/DynamicLibraryManagerSymbol.cpp

View check run for this annotation

Codecov / codecov/patch

lib/Interpreter/DynamicLibraryManagerSymbol.cpp#L924

Added line #L924 was not covered by tests
if (Name.empty())
continue;

Expand Down

0 comments on commit 8d527a5

Please sign in to comment.