On Jan 29, 2009, at 8:46 PM, Zhongxing Xu wrote: > > = > = > = > = > = > = > = > = > ====================================================================== > --- 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'.
Hmm. Just to put a naive suggestion out there: maybe the RValueType of this AnonTypeRegion should be 'char' or an 'ArrayType' (since it represents chunk of memory). The RValueType of the region itself definitely isn't a char* (but it's LValueType) is. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
