[cfe-commits] r99904 - in /cfe/trunk: lib/Checker/GRExprEngine.cpp test/Analysis/misc-ps-region-store.m
Ted Kremenek
kremenek at apple.com
Tue Mar 30 11:24:54 PDT 2010
Author: kremenek
Date: Tue Mar 30 13:24:54 2010
New Revision: 99904
URL: http://llvm.org/viewvc/llvm-project?rev=99904&view=rev
Log:
Change the analyzer to recognize (but ignore) assignments to isa. Fixes PR 6302.
Modified:
cfe/trunk/lib/Checker/GRExprEngine.cpp
cfe/trunk/test/Analysis/misc-ps-region-store.m
Modified: cfe/trunk/lib/Checker/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRExprEngine.cpp?rev=99904&r1=99903&r2=99904&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Checker/GRExprEngine.cpp Tue Mar 30 13:24:54 2010
@@ -897,6 +897,11 @@
return;
}
+ case Stmt::ObjCIsaExprClass:
+ // FIXME: Do something more intelligent with 'x->isa = ...'.
+ // For now, just ignore the assignment.
+ return;
+
case Stmt::ObjCPropertyRefExprClass:
case Stmt::ObjCImplicitSetterGetterRefExprClass:
// FIXME: Property assignments are lvalues, but not really "locations".
Modified: cfe/trunk/test/Analysis/misc-ps-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.m?rev=99904&r1=99903&r2=99904&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.m (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.m Tue Mar 30 13:24:54 2010
@@ -910,3 +910,13 @@
struct rdar_7770737_s f = { .p = (intptr_t)&x };
return x; // expected-warning{{Undefined or garbage value returned to caller}}
}
+
+//===----------------------------------------------------------------------===//
+// Test handling of the implicit 'isa' field. For now we don't do anything
+// interesting.
+//===----------------------------------------------------------------------===//
+
+void pr6302(id x, Class y) {
+ // This previously crashed the analyzer (reported in PR 6302)
+ x->isa = y;
+}
More information about the cfe-commits
mailing list