Skip to content

Commit

Permalink
[vfs] Assert that the status is known in equivalent().
Browse files Browse the repository at this point in the history
Otherwise we'd silently compare uninitialized data.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308604 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
d0k committed Jul 20, 2017
1 parent d8f8a92 commit c176e5d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/Basic/VirtualFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c176e5d

Please sign in to comment.