]> granicus.if.org Git - clang/commitdiff
Change the analyzer to recognize (but ignore) assignments to isa. Fixes PR 6302.
authorTed Kremenek <kremenek@apple.com>
Tue, 30 Mar 2010 18:24:54 +0000 (18:24 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 30 Mar 2010 18:24:54 +0000 (18:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99904 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/GRExprEngine.cpp
test/Analysis/misc-ps-region-store.m

index ae4c5fe3c1216467dbe59586489adac61c37ad1f..1afe0917f1c507f5167b53d51fbaae698a91b9a5 100644 (file)
@@ -897,6 +897,11 @@ void GRExprEngine::VisitLValue(Expr* Ex, ExplodedNode* Pred,
       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".
index 898a33efe12440deacd5ff6c90957b09558e017a..b95d82f76330d498848ea161713ab9accf5f6fba 100644 (file)
@@ -910,3 +910,13 @@ int rdar_7770737_pos(void)
   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;
+}