[cfe-commits] r71431 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Ted Kremenek kremenek at apple.com
Mon May 11 08:07:55 PDT 2009


Why is this too general of an assumption?  For example, couldn't we be  
invalidating a field?

On May 11, 2009, at 7:28 AM, Zhongxing Xu <xuzhongxing at gmail.com> wrote:

> Author: zhongxingxu
> Date: Mon May 11 09:28:14 2009
> New Revision: 71431
>
> URL: http://llvm.org/viewvc/llvm-project?rev=71431&view=rev
> Log:
> TypedRegion is a too general assumption. Usually we only want to  
> invalidate
> the VarRegion as a super region of an ElementRegion.
>
> Modified:
>    cfe/trunk/lib/Analysis/CFRefCount.cpp
>
> Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=71431&r1=71430&r2=71431&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
> +++ cfe/trunk/lib/Analysis/CFRefCount.cpp Mon May 11 09:28:14 2009
> @@ -2660,7 +2660,7 @@
>         if (R) {
>           // Are we dealing with an ElementRegion?  If the element  
> type is
>           // a basic integer type (e.g., char, int) and the  
> underying region
> -          // is also typed then strip off the ElementRegion.
> +          // is a variable region then strip off the ElementRegion.
>           // FIXME: We really need to think about this for the  
> general case
>           //   as sometimes we are reasoning about arrays and other  
> times
>           //   about (char*), etc., is just a form of passing raw  
> bytes.
> @@ -2674,8 +2674,8 @@
>             // still allowing us to do checker-specific logic (e.g.,
>             // invalidating reference counts), probably via callbacks.
>             if (ER->getElementType()->isIntegralType())
> -              if (const TypedRegion *superReg =
> -                  dyn_cast<TypedRegion>(ER->getSuperRegion()))
> +              if (const VarRegion *superReg =
> +                  dyn_cast<VarRegion>(ER->getSuperRegion()))
>                 R = superReg;
>             // FIXME: What about layers of ElementRegions?
>           }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list