forked from OSchip/llvm-project
[analyzer] Fix return of llvm::StringRef to destroyed std::string
This issue was discovered whilst testing with ASAN. Differential Revision: https://reviews.llvm.org/D124683
This commit is contained in:
parent
d5198cf92f
commit
57c55165eb
|
@ -98,11 +98,13 @@ private:
|
|||
};
|
||||
}
|
||||
|
||||
static inline std::vector<llvm::StringRef> toRefs(std::vector<std::string> V) {
|
||||
static inline std::vector<llvm::StringRef>
|
||||
toRefs(const std::vector<std::string> &V) {
|
||||
return std::vector<llvm::StringRef>(V.begin(), V.end());
|
||||
}
|
||||
|
||||
static decltype(auto) callsNames(std::vector<std::string> FunctionNames) {
|
||||
static decltype(auto)
|
||||
callsNames(const std::vector<std::string> &FunctionNames) {
|
||||
return callee(functionDecl(hasAnyName(toRefs(FunctionNames))));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue