Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick PR #3939: Print an error message and return instead of crash #3953

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion starboard/elf_loader/exported_symbols.cc
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ const void* ExportedSymbols::Lookup(const char* name) {
const void* address = map_[name];
// Any symbol that is not registered as part of the Starboard API in the
// constructor of this class is a leak, and is an error.
SB_CHECK(address) << "Failed to retrieve the address of '" << name << "'.";
if (!address) {
SB_LOG(ERROR) << "Failed to retrieve the address of '" << name << "'.";
}
return address;
}

Expand Down
1 change: 1 addition & 0 deletions starboard/elf_loader/exported_symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace elf_loader {
class ExportedSymbols {
public:
ExportedSymbols();
// Returns the address of the symbol |name|. If it's not found, returns NULL.
const void* Lookup(const char* name);

private:
Expand Down
Loading