ioeric updated this revision to Diff 74631.
ioeric added a comment.

- Separate assertions to get more information.


https://reviews.llvm.org/D25597

Files:
  lib/Basic/VirtualFileSystem.cpp


Index: lib/Basic/VirtualFileSystem.cpp
===================================================================
--- lib/Basic/VirtualFileSystem.cpp
+++ lib/Basic/VirtualFileSystem.cpp
@@ -1477,9 +1477,12 @@
 RedirectingFileSystem::lookupPath(sys::path::const_iterator Start,
                                   sys::path::const_iterator End, Entry *From) {
 #ifndef LLVM_ON_WIN32
-  assert(!isTraversalComponent(*Start) &&
-         !isTraversalComponent(From->getName()) &&
-         "Paths should not contain traversal components");
+  // FIXME: `remove_dots` does not remove leading "../" anymore, might need
+  // better test here.
+  assert(!Start->equals(".") &&
+         "Start should not be \".\"");
+  assert(!isTraversalComponent(From->getName()) &&
+         "From->getName() should not contain traversal components");
 #else
   // FIXME: this is here to support windows, remove it once canonicalized
   // paths become globally default.


Index: lib/Basic/VirtualFileSystem.cpp
===================================================================
--- lib/Basic/VirtualFileSystem.cpp
+++ lib/Basic/VirtualFileSystem.cpp
@@ -1477,9 +1477,12 @@
 RedirectingFileSystem::lookupPath(sys::path::const_iterator Start,
                                   sys::path::const_iterator End, Entry *From) {
 #ifndef LLVM_ON_WIN32
-  assert(!isTraversalComponent(*Start) &&
-         !isTraversalComponent(From->getName()) &&
-         "Paths should not contain traversal components");
+  // FIXME: `remove_dots` does not remove leading "../" anymore, might need
+  // better test here.
+  assert(!Start->equals(".") &&
+         "Start should not be \".\"");
+  assert(!isTraversalComponent(From->getName()) &&
+         "From->getName() should not contain traversal components");
 #else
   // FIXME: this is here to support windows, remove it once canonicalized
   // paths become globally default.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to