forked from OSchip/llvm-project
Fix UBSan issue with PPC::isValidCPUName
Apparently storing the pointer to a StringLiteral as a StringRef caused this section of code to issue a ubsan warning. This will hopefully fix that. llvm-svn: 324687
This commit is contained in:
parent
a37e00968e
commit
fa69c71dce
|
@ -493,8 +493,7 @@ static constexpr llvm::StringLiteral ValidCPUNames[] = {
|
|||
};
|
||||
|
||||
bool PPCTargetInfo::isValidCPUName(StringRef Name) const {
|
||||
const StringRef *FoundName = llvm::find(ValidCPUNames, Name);
|
||||
return FoundName != std::end(ValidCPUNames);
|
||||
return llvm::find(ValidCPUNames, Name) != std::end(ValidCPUNames);
|
||||
}
|
||||
|
||||
void PPCTargetInfo::fillValidCPUList(SmallVectorImpl<StringRef> &Values) const {
|
||||
|
|
Loading…
Reference in New Issue