]> granicus.if.org Git - llvm/commit
getMainExecutable: handle realpath() failure, falling back to getprogpath().
authorSam McCall <sam.mccall@gmail.com>
Tue, 2 Jul 2019 15:42:37 +0000 (15:42 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 2 Jul 2019 15:42:37 +0000 (15:42 +0000)
commitdf7c6428b2ae295aacf7d057e4a7b9250dc94e48
tree9bcc90dabe6dc90fd1ebc280e48afbd486cdc5b5
parent344372bde76af2babe2c7dd55a84ebf223d8d7a8
getMainExecutable: handle realpath() failure, falling back to getprogpath().

Summary:
Previously, we'd pass a nullptr to std::string and crash().

This case happens when the binary is deleted while being used (e.g. rebuilding clangd).

Reviewers: kadircet

Subscribers: ilya-biryukov, kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64068

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364936 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/Unix/Path.inc