From: Nico Weber Date: Fri, 24 Apr 2015 22:18:46 +0000 (+0000) Subject: Assert that Process::FindInEnvPath() is passed a relative path. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=941813305546c1ee937e6aaeb96b541aa9097295;p=llvm Assert that Process::FindInEnvPath() is passed a relative path. 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 --- diff --git a/lib/Support/Process.cpp b/lib/Support/Process.cpp index 3571cd3132e..6dcbb47e87d 100644 --- a/lib/Support/Process.cpp +++ b/lib/Support/Process.cpp @@ -29,6 +29,7 @@ using namespace sys; Optional Process::FindInEnvPath(const std::string& EnvName, const std::string& FileName) { + assert(!path::is_absolute(FileName)); Optional FoundPath; Optional OptPath = Process::GetEnv(EnvName); if (!OptPath.hasValue())