The present invention provides systems and methods for preventing software errors
caused by address range or alignment errors. In architecture, a representative
system includes a compiler that parses a program and further comprises a logic
that generates a verification value for a block of code in the program, a logic
that stores the verification value in the block of code, and a logic that inserts
verification value instruction code into the block of code. The present invention
can also be viewed as a method for preventing software errors in a program. A representative
method operates by generating a verification value for a block of code in the program,
and storing the verification value in the block of code. During execution of the
program, a runtime verification value is generated for the block of code, and the
block of code is executed if the verification value equals the runtime verification
value, and generates an error message if the verification value does not equals
the runtime verification value.