[PATCH] D121733: Clean pathnames in FileManager.

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 15:57:24 PDT 2022


rnk added a comment.

I've been somewhat afraid to touch this code because of symlinks. Is that something we need to worry about? Consider this path: root/symlink/../foo.h. remove_dots will turn this into root/foo.h, but if symlink points to some unrelated directory, the .. directory entry points to something other than root. I can't imagine that people rely on this behavior often, but I could be wrong.

If the consequences are mostly that diagnostics and  `__FILE__`  in such a case refer to non-existent files, I can live with that, it's just a moderate reduction in usability for what seems like unreasonable usage.

I have also wanted to do slash canonicalization at this exact point, to respect the user setting.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733



More information about the cfe-commits mailing list