This revision was automatically updated to reflect the committed changes. Closed by commit rG57c55165ebe8: [analyzer] Fix return of llvm::StringRef to destroyed std::string (authored by andrewng). Herald added a project: clang. Herald added a subscriber: cfe-commits.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124683/new/ https://reviews.llvm.org/D124683 Files: clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp Index: clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp @@ -98,11 +98,13 @@ }; } -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)))); }
Index: clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp @@ -98,11 +98,13 @@ }; } -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)))); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits