From: Zhongxing Xu Date: Mon, 11 May 2009 14:28:14 +0000 (+0000) Subject: TypedRegion is a too general assumption. Usually we only want to invalidate X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e7c6781652f2b0aafa0b95ab215a27ff8a84103;p=clang TypedRegion is a too general assumption. Usually we only want to invalidate the VarRegion as a super region of an ElementRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71431 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 4b254e07d5..d3702ec8eb 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -2660,7 +2660,7 @@ void CFRefCount::EvalSummary(ExplodedNodeSet& Dst, 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 @@ void CFRefCount::EvalSummary(ExplodedNodeSet& Dst, // 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(ER->getSuperRegion())) + if (const VarRegion *superReg = + dyn_cast(ER->getSuperRegion())) R = superReg; // FIXME: What about layers of ElementRegions? }