From eb677f6036ac4a779c9088b8e0d1ef4ec4206c4f Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 26 Sep 2019 11:30:47 +0000 Subject: [PATCH] MetadataLoader lazyLoadOneMetadata - silence static analyzer dyn_cast null dereference warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast directly and if not assert will fire for us. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372966 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/MetadataLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Bitcode/Reader/MetadataLoader.cpp b/lib/Bitcode/Reader/MetadataLoader.cpp index fa50ec5766a..049164c7be7 100644 --- a/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/lib/Bitcode/Reader/MetadataLoader.cpp @@ -987,7 +987,7 @@ void MetadataLoader::MetadataLoaderImpl::lazyLoadOneMetadata( assert(ID >= MDStringRef.size() && "Unexpected lazy-loading of MDString"); // Lookup first if the metadata hasn't already been loaded. if (auto *MD = MetadataList.lookup(ID)) { - auto *N = dyn_cast_or_null(MD); + auto *N = cast(MD); if (!N->isTemporary()) return; } -- 2.40.0