Procházet zdrojové kódy

[vfs] Assert that the status is known in equivalent().

Otherwise we'd silently compare uninitialized data.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308604 91177308-0d34-0410-b5e6-96231b3b80d8
Benjamin Kramer před 8 roky
rodič
revize
c176e5d1cd
1 změnil soubory, kde provedl 1 přidání a 0 odebrání
  1. 1 0
      lib/Basic/VirtualFileSystem.cpp

+ 1 - 0
lib/Basic/VirtualFileSystem.cpp

@@ -59,6 +59,7 @@ Status Status::copyWithNewName(const file_status &In, StringRef NewName) {
 }
 
 bool Status::equivalent(const Status &Other) const {
+  assert(isStatusKnown() && Other.isStatusKnown());
   return getUniqueID() == Other.getUniqueID();
 }
 bool Status::isDirectory() const {