Commit f9ca452c by Jonah Ryan-Davis Committed by Commit Bot

Fix out_of_range error in System_utils_posix

This now handles the case where dladdr doesn't return any information about the filename. This was causing issues on Fuschia. Bug: chromium:1198567 Change-Id: I892106282fc930d4d26e3eecd720a11e05b8dcd8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2896171Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
parent 9c262ad0
......@@ -68,7 +68,7 @@ std::string GetModuleDirectory()
}
// Ensure we return the full path to the module, not the relative path
Optional<std::string> cwd = GetCWD();
if (directory.at(0) != '/' && cwd.valid())
if (!directory.empty() && directory.at(0) != '/' && cwd.valid())
{
directory = cwd.value() + GetPathSeparator() + directory;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment