Patent ID: 7962832

Claim:
A method for detecting a memory error within source code of a computer program stored in a memory, comprising: (a) generating an original block indication variable for indicating a starting memory block of an allocated memory region, the allocated memory region having bounds; (b) adding an error check source code to the source code of the computer program that performs a computing operation, wherein the error check source code is added before portions of the source code of the computer program where memory access will occur, and wherein the computing operation checks for memory errors; (c) generating an identification code map region using the original block indication variable, the identification code map region stored in the memory; (d) detecting if an out of bounds memory error will occur when the allocated memory region is accessed before the allocated memory region is accessed by executing the error check source code to perform the computing operation, wherein the computing operation uses the identification code map region and at least one of a target block indication variable and the original block indication variable, wherein the target block indication variable indicates a memory block to be accessed in the allocated memory region, and wherein the computing operation checks whether the target block indication variable indicates a memory block outside the bounds of the allocated memory region, and determines a memory error if the target block indication variable indicates a memory block outside the bounds of the allocated memory region; and (e) outputting information about a detected memory error.