[PATCH] D65675: [Path] Fix bug in make_absolute logic

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 02:07:25 PDT 2019


labath added a comment.

There was definitely a problem with the previous implementation, but I don't believe this is quite right either. After all the code you're editing is in the `rootName && !rootDir` branch, so `p` should contain a root name, and it makes sense to use that instead of the one in the current dir. I am not super-familiar with this code, but it seems to me that the problem is that you even reach this piece of code for a path like `foo.cpp`. This happens because we hard-code `rootName` to true for posix-style paths. This happens to be correct for the "Already absolute?" check, but I'm not sure it's correct for everything that comes after that..

So, I'd try to fix this by splitting the logic for "is this a posix path" from "does this path contain a root name", but it would be nice if someone could confirm that this is the right approach...


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65675/new/

https://reviews.llvm.org/D65675





More information about the llvm-commits mailing list