[llvm-commits] checking of inbounds for multi dimensional arrary and struct array on isInBoundsIndices()

Dan Gohman gohman at apple.com
Thu Mar 3 11:42:53 PST 2011


On Mar 2, 2011, at 9:00 PM, Jin Gu Kang wrote: 
> char a[3][2];
> struct test {
>   char a;
>   int b;
> };
> struct test foo[3];
[…]
> -------------------------------------------------------------------
> isInBoundsIndices() doesn't return inbounds flag as true on
> a[3][1] = 3,  a[3][2] = 4 and  foo[3].b = 7.

That's the intended behavior. The one-past-the-end rule for inbounds
only applies to the address immediately after the end of the
object, which would be just &a[3][0] and &foo[3].a.

Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110303/b15f52e0/attachment.html>


More information about the llvm-commits mailing list