[cfe-commits] r74407 - in /cfe/trunk/lib/Analysis: BasicStore.cpp RegionStore.cpp

Ted Kremenek kremenek at apple.com
Tue Jun 30 12:47:20 PDT 2009


Hi Zhongxing,

Do you have a test case to accompany this patch that can go in the  
test suite?  It's not 100% clear to me how this gets triggered.

Ted

On Jun 28, 2009, at 3:16 AM, Zhongxing Xu wrote:

> Author: zhongxingxu
> Date: Sun Jun 28 05:16:11 2009
> New Revision: 74407
>
> URL: http://llvm.org/viewvc/llvm-project?rev=74407&view=rev
> Log:
> Do not crash on binding concrete integer location.
>
> Modified:
>    cfe/trunk/lib/Analysis/BasicStore.cpp
>    cfe/trunk/lib/Analysis/RegionStore.cpp
>
> Modified: cfe/trunk/lib/Analysis/BasicStore.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicStore.cpp?rev=74407&r1=74406&r2=74407&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
> +++ cfe/trunk/lib/Analysis/BasicStore.cpp Sun Jun 28 05:16:11 2009
> @@ -319,6 +319,9 @@
> }
>
> Store BasicStoreManager::BindInternal(Store store, Loc loc, SVal V) {
> +  if (isa<loc::ConcreteInt>(loc))
> +    return store;
> +
>   const MemRegion* R = cast<loc::MemRegionVal>(loc).getRegion();
>   ASTContext &C = StateMgr.getContext();
>
>
> Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=74407&r1=74406&r2=74407&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
> +++ cfe/trunk/lib/Analysis/RegionStore.cpp Sun Jun 28 05:16:11 2009
> @@ -1074,6 +1074,9 @@
> }
>
> const GRState *RegionStoreManager::Bind(const GRState *state, Loc L,  
> SVal V) {
> +  if (isa<loc::ConcreteInt>(L))
> +    return state;
> +
>   // If we get here, the location should be a region.
>   const MemRegion* R = cast<loc::MemRegionVal>(L).getRegion();
>
>
>
> _______________________________________________
> 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