On Tue, Aug 3, 2010 at 9:39 AM, Jordy Rose <[email protected]> wrote: > > On Tue, 3 Aug 2010 09:25:08 +0800, Zhongxing Xu <[email protected]> > wrote: >> On Tue, Aug 3, 2010 at 12:12 AM, Ted Kremenek <[email protected]> > wrote: >>> On Aug 1, 2010, at 9:56 PM, Zhongxing Xu <[email protected]> wrote: >>> >>>> +/// Represent a region's offset within the top level base region. >>>> +class RegionOffset { >>>> + /// The base region. >>>> + const MemRegion *R; >>>> + >>>> + /// The bit offset within the base region. It shouldn't be > negative. >>>> + uint64_t Offset; >>> >>> Why is the offset guaranteed to be non-negative? Can't we construct >>> ElementRegions with a negative index? >>> >> >> Because the offset is within the toplevel object region and used for >> representing region bindings, binding to a negative index is illegal. > > Not if the top-level region is a symbolic region representing an argument > pointer. This is perfectly valid, if a little cringe-worthy: > > void foo (const int *a) { > int prev = a[-1]; > } >
This makes sense. I'll change the offset into a signed int. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
