July 2002
Intermediate to advanced
320 pages
8h 15m
English
By “bounds checking” we mean to verify that an integer x is within two bounds a and b—that is, that
![]()
We first assume that all quantities are signed integers.
An important application is the checking of array indexes. For example, suppose a one-dimensional array A can be indexed by values from 1 to 10. Then, for a reference A(i), a compiler might generate code to check that
![]()
and to branch or trap if this is not the case. In this section we show that this check can be done with a single comparison, by performing ...
Read now
Unlock full access