[cfe-commits] r138762 - in /cfe/trunk: lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp test/Analysis/keychainAPI.m
Anna Zaks
ganna at apple.com
Mon Aug 29 13:43:37 PDT 2011
Author: zaks
Date: Mon Aug 29 15:43:37 2011
New Revision: 138762
URL: http://llvm.org/viewvc/llvm-project?rev=138762&view=rev
Log:
Fix: Bug 10798 - [analyzer] Crash when analyzing ICU. (A slight improvement on the previous commit.)
Modified:
cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
cfe/trunk/test/Analysis/keychainAPI.m
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp?rev=138762&r1=138761&r2=138762&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp Mon Aug 29 15:43:37 2011
@@ -203,7 +203,7 @@
// region, if that is the case, get the underlining region.
if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
R = ER->getAsArrayOffset().getRegion();
- if (!isa<SymbolicRegion>(R))
+ if (!R || !isa<SymbolicRegion>(R))
return 0;
} else
return 0;
Modified: cfe/trunk/test/Analysis/keychainAPI.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/keychainAPI.m?rev=138762&r1=138761&r2=138762&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/keychainAPI.m (original)
+++ cfe/trunk/test/Analysis/keychainAPI.m Mon Aug 29 15:43:37 2011
@@ -310,3 +310,14 @@
const char *__WBASLLevelString(int level) {
return "foo";
}
+
+static int *bug10798(int *p, int columns, int prevRow) {
+ int *row = 0;
+ row = p + prevRow * columns;
+ prevRow += 2;
+ do {
+ ++prevRow;
+ row+=columns;
+ } while(10 >= row[1]);
+ return row;
+}
More information about the cfe-commits
mailing list