Assert that Process::FindInEnvPath() is passed a relative path.
authorNico Weber <nicolasweber@gmx.de>
Fri, 24 Apr 2015 22:18:46 +0000 (22:18 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 24 Apr 2015 22:18:46 +0000 (22:18 +0000)
It misbehaves with absolute paths. (So does path::append().)
Goes with clang r235787.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235788 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Process.cpp

index 3571cd3132e5ebb34fa0c506a43882677c1ebe20..6dcbb47e87d0a9fbfa4f8dc0f3e2e8ca5d65762c 100644 (file)
@@ -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())