forked from OSchip/llvm-project
[mlir] NFC - Fix OperationSupport.cpp::findNamedAttr
Summary: When NamedAttrList::get is called against a StringRef and the entry is not present, the Identifier::operator== crashes. Interestingly there seems to be no use of the NamedAttrList::get(StringRef) in the codebase so far. A subsequent commit will introduce such a use. Differential Revision: https://reviews.llvm.org/D80089
This commit is contained in:
parent
57d8b8d6f0
commit
79f059c4ac
|
@ -97,7 +97,7 @@ static auto *findAttr(SmallVectorImpl<NamedAttribute> &attrs, T name,
|
|||
}
|
||||
|
||||
auto *it = llvm::lower_bound(attrs, name);
|
||||
if (it->first != name)
|
||||
if (it == attrs.end() || it->first != name)
|
||||
return attrs.end();
|
||||
return it;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue