forked from OSchip/llvm-project
MetadataLoader lazyLoadOneMetadata - silence static analyzer dyn_cast<MDNode> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<MDNode> directly and if not assert will fire for us. llvm-svn: 372966
This commit is contained in:
parent
cce4b8848b
commit
8739999778
|
@ -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<MDNode>(MD);
|
||||
auto *N = cast<MDNode>(MD);
|
||||
if (!N->isTemporary())
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue