[cfe-commits] r63347 - in /cfe/trunk: include/clang/Analysis/PathSensitive/BasicValueFactory.h include/clang/Analysis/PathSensitive/MemRegion.h include/clang/Analysis/PathSensitive/SVals.h lib/Analysis/MemRegion.cpp lib/Analysis/RegionStore.cpp l

Zhongxing Xu xuzhongxing at gmail.com
Thu Jan 29 20:46:36 PST 2009


>
>
>
> ==============================================================================
> --- cfe/trunk/lib/Analysis/MemRegion.cpp (original)
> +++ cfe/trunk/lib/Analysis/MemRegion.cpp Thu Jan 29 18:08:43 2009
> @@ -114,8 +114,9 @@
>   if (ArrayType* AT = dyn_cast<ArrayType>(T.getTypePtr()))
>     return AT->getElementType();
>
> -  PointerType* PtrT = cast<PointerType>(T.getTypePtr());
> -  return C.getCanonicalType(PtrT->getPointeeType());
> +  // If the RValueType of the array region isn't an ArrayType, then
> essentially
> +  // the element's
> +  return T;
>  }
>

Hi Ted,

This perhaps does not work for code like:

char* p = (char*) alloca(4);
char* c = p[1];

The array region of element region p[1] is an AnonTypedRegion, whose type is
'pointer to char'.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090130/40e720e4/attachment.html>


More information about the cfe-commits mailing list