|array bounds checking firstname.lastname@example.org (dz) (2005-11-26)|
|Re: array bounds checking email@example.com (2005-11-27)|
|Re: array bounds checking firstname.lastname@example.org (Sudesh Chandna, Noida) (2005-11-29)|
|Re: array bounds checking email@example.com (glen herrmannsfeldt) (2005-12-03)|
|Re: array bounds checking firstname.lastname@example.org (2005-12-08)|
|Re: Array bounds checking email@example.com (1990-06-15)|
|From:||"Sudesh Chandna, Noida" <firstname.lastname@example.org>|
|Date:||29 Nov 2005 16:09:05 -0500|
|Posted-Date:||29 Nov 2005 16:09:05 EST|
> I am wondering if anybody knew how array bounds checks worked when
>they are references through multiple indirections of pointers. Eg: p =
>A ; q= &p; ***q+100=0; So q is referencing A. And hence I would like a
>check inserted there.
> Do array bounds checking handle these cases, because
>this also would need pointer analysis.
This can be easily done by having a data structure commonly known as
"descriptor" for pointer which can hold lower bound, upper bound, stride
corresponding to all dimensions of the array. Also descriptor should have rank
( dimension ) and address of the array. Now for languages such as FORTRAN
where its possible to say
Ptr => ary(1:10:2)
Descriptor values lower bound would be 1
Upper bound would be 5
Stride would be say 8 (2*size of element)
Rank would be 1
And addr will hold starting address.
This information can be used at runtime to do bounds checking.
Thanks & Best Regards,
Senior Member Technical Staff
Return to the
Search the comp.compilers archives again.