diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-11 16:42:41 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-11 16:43:02 +0000 |
commit | fce887beb79780d0e0b19e8ab6176978a3dce9b8 (patch) | |
tree | 45df9ca1ca8ebe5dd169e68c421ce72e4463ad24 /clang/lib/Serialization/GlobalModuleIndex.cpp | |
parent | bf03944d5d9a7e7c8105c69dfa0d7e0d345644df (diff) | |
download | bcm5719-llvm-fce887beb79780d0e0b19e8ab6176978a3dce9b8.tar.gz bcm5719-llvm-fce887beb79780d0e0b19e8ab6176978a3dce9b8.zip |
GlobalModuleIndex - Fix use-after-move clang static analyzer warning.
Shadow variable names meant we were referencing the Buffer input argument, not the GlobalModuleIndex member that its std::move()'d it.
Diffstat (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 89a1c6cb8e6..462d29c2a0f 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -125,11 +125,12 @@ typedef llvm::OnDiskIterableChainedHashTable<IdentifierIndexReaderTrait> } -GlobalModuleIndex::GlobalModuleIndex(std::unique_ptr<llvm::MemoryBuffer> Buffer, - llvm::BitstreamCursor Cursor) - : Buffer(std::move(Buffer)), IdentifierIndex(), NumIdentifierLookups(), +GlobalModuleIndex::GlobalModuleIndex( + std::unique_ptr<llvm::MemoryBuffer> IndexBuffer, + llvm::BitstreamCursor Cursor) + : Buffer(std::move(IndexBuffer)), IdentifierIndex(), NumIdentifierLookups(), NumIdentifierLookupHits() { - auto Fail = [&Buffer](llvm::Error &&Err) { + auto Fail = [&](llvm::Error &&Err) { report_fatal_error("Module index '" + Buffer->getBufferIdentifier() + "' failed: " + toString(std::move(Err))); }; |