diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-04-24 22:18:46 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-04-24 22:18:46 +0000 |
commit | 7d831a5731e9b4002822fb2bdfbbd26184480767 (patch) | |
tree | b7d2415fcf7f28187b2251f0b25e47e14f073e18 /llvm/lib/Support/Process.cpp | |
parent | 1f0f165d50211e72d41395abd74def920347380e (diff) | |
download | bcm5719-llvm-7d831a5731e9b4002822fb2bdfbbd26184480767.tar.gz bcm5719-llvm-7d831a5731e9b4002822fb2bdfbbd26184480767.zip |
Assert that Process::FindInEnvPath() is passed a relative path.
It misbehaves with absolute paths. (So does path::append().)
Goes with clang r235787.
llvm-svn: 235788
Diffstat (limited to 'llvm/lib/Support/Process.cpp')
-rw-r--r-- | llvm/lib/Support/Process.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp index 3571cd3132e..6dcbb47e87d 100644 --- a/llvm/lib/Support/Process.cpp +++ b/llvm/lib/Support/Process.cpp @@ -29,6 +29,7 @@ using namespace sys; Optional<std::string> Process::FindInEnvPath(const std::string& EnvName, const std::string& FileName) { + assert(!path::is_absolute(FileName)); Optional<std::string> FoundPath; Optional<std::string> OptPath = Process::GetEnv(EnvName); if (!OptPath.hasValue()) |