[gdb-remote] Sanity check platform pointer

llvm-svn: 354012
This commit is contained in:
Aaron Smith 2019-02-14 08:59:04 +00:00
parent 91c4fa9d32
commit bc47289511
1 changed files with 5 additions and 2 deletions

View File

@ -979,8 +979,11 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
g_debugserver_file_spec = debugserver_file_spec;
} else {
debugserver_file_spec =
platform->LocateExecutable(DEBUGSERVER_BASENAME);
if (platform)
debugserver_file_spec =
platform->LocateExecutable(DEBUGSERVER_BASENAME);
else
debugserver_file_spec.Clear();
if (debugserver_file_spec) {
// Platform::LocateExecutable() wouldn't return a path if it doesn't
// exist