diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2017-10-03 23:15:35 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2017-10-03 23:15:35 +0000 |
commit | 367fbfcc2019be6876471dd0957f258dfc431387 (patch) | |
tree | d04de0cccb54ad21d7f1df99faf2680589f6ced1 /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | |
parent | 15b832796348adce0c73ef1e63da28d1a8aaaae3 (diff) | |
download | bcm5719-llvm-367fbfcc2019be6876471dd0957f258dfc431387.tar.gz bcm5719-llvm-367fbfcc2019be6876471dd0957f258dfc431387.zip |
[Analyzer] Re-apply r314820 with a fix for StringRef lifetime.
Fixes the test failure: temporary is now bound to std::string, tests
fully pass on Linux.
This reverts commit b36ee0924038e1d95ea74230c62d46e05f80587e.
llvm-svn: 314859
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 165bc049938..09a64899df0 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -1062,6 +1062,7 @@ RetainSummaryManager::getFunctionSummary(const FunctionDecl *FD) { // Inspect the result type. QualType RetTy = FT->getReturnType(); + std::string RetTyName = RetTy.getAsString(); // FIXME: This should all be refactored into a chain of "summary lookup" // filters. @@ -1081,12 +1082,14 @@ RetainSummaryManager::getFunctionSummary(const FunctionDecl *FD) { AllowAnnotations = false; } else if (FName == "CFPlugInInstanceCreate") { S = getPersistentSummary(RetEffect::MakeNoRet()); - } else if (FName == "IOBSDNameMatching" || + } else if (FName == "IORegistryEntrySearchCFProperty" + || (RetTyName == "CFMutableDictionaryRef" && ( + FName == "IOBSDNameMatching" || FName == "IOServiceMatching" || FName == "IOServiceNameMatching" || - FName == "IORegistryEntrySearchCFProperty" || FName == "IORegistryEntryIDMatching" || - FName == "IOOpenFirmwarePathMatching") { + FName == "IOOpenFirmwarePathMatching" + ))) { // Part of <rdar://problem/6961230>. (IOKit) // This should be addressed using a API table. S = getPersistentSummary(RetEffect::MakeOwned(RetEffect::CF), |