summaryrefslogtreecommitdiffstats
path: root/lib/Serialization
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2017-06-02 17:30:24 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2017-06-02 17:30:24 +0000
commitd9cc152d851f682344a4db8070d9542f1913731c (patch)
treea16278db464621c1bcffa2cbc92471be558c678c /lib/Serialization
parentb4530cfcf71b67629177695d40973b21cd57e3d9 (diff)
[Modules] Fix use after scope.
Found by asan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization')
-rw-r--r--lib/Serialization/ASTWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index f9e908e790..044a26433a 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -1989,6 +1989,7 @@ void ASTWriter::WriteHeaderSearch(const HeaderSearch &HS) {
// have resolved them before we get here, but not necessarily: we might be
// compiling a preprocessed module, where there is no requirement for the
// original files to exist any more.
+ const HeaderFileInfo Empty; // So we can take a reference.
if (WritingModule) {
llvm::SmallVector<Module *, 16> Worklist(1, WritingModule);
while (!Worklist.empty()) {
@@ -2027,7 +2028,7 @@ void ASTWriter::WriteHeaderSearch(const HeaderSearch &HS) {
FilenameDup, *U.Size, IncludeTimestamps ? *U.ModTime : 0
};
HeaderFileInfoTrait::data_type Data = {
- {}, {}, {M, ModuleMap::headerKindToRole(U.Kind)}
+ Empty, {}, {M, ModuleMap::headerKindToRole(U.Kind)}
};
// FIXME: Deal with cases where there are multiple unresolved header
// directives in different submodules for the same header.