[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 illegal opcodes questions



In article <1148890072.982487.177830@j33g2000cwa.googlegroups.com>,
mdj <mdj.mdj@gmail.com> wrote:
>Paul Schlyter wrote:
>
>> It's easy to exceed the bounds of an array by accident and overwrite other
>> data structures in the program with garbage.  Apparently it's no more difficult
>> in Ada than in FORTRAN or C ......
>
>Ada provides bounds checking on array indices, and in addition provides
>an "in" construct which can be used to iterate over an array without
>specifying the number of iterations in the loop construct as you
>typically would in C
>
>To fall over the edge of an array in Ada, you'd need to do this quite
>deliberately. It would require determining the address of either the
>first or last element, and deliberately modifying the pointer to
>overstep the array bounds.
>
>In short, this never happens "by accident" in Ada, it must happen by
>design. This pretty much means that in practice, it never happens.
>
>Matt

So this bounds checking can not be turned off in Ada, for efficiency ?




-- 
----------------------------------------------------------------
Paul Schlyter,  Grev Turegatan 40,  SE-114 38 Stockholm,  SWEDEN
e-mail:  pausch at stockholm dot bostream dot se
WWW:     http://stjarnhimlen.se/