On Tue, Mar 30, 2010 at 11:24 AM, Ted Kremenek <[email protected]> wrote:
> 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.

There isn't that much code in the world that assigns to isa, and its
usually doing something which is going to be very hard for the static
analyzer to understand. It probably makes sense to just give up.

 - Daniel

> 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;
> +}
>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to