Patent ID: 8578343

Claim:
A method for overflow detection using partial evaluations comprising: obtaining a section of code from a source code file stored on a storage device; identifying, within the section of code, an access statement to access a buffer; identifying, within the access statement, an index used to access the buffer, wherein the index is statically-computable; determining bounds of the buffer; identifying a plurality of statements that are statically-computable and affect the index; generating a code segment comprising the plurality of statements and the access statement; replacing the access statement of the code segment with a conditional statement returning true when the index exceeds the bounds of the buffer; adding an unconditional statement returning false to the code segment; adding a bail out conditional statement to the code segment, wherein the bail out conditional statement is configured to interrupt execution of the code segment when a specified number of iterations in the code segment are performed; executing the code segment on a computer processor to obtain a return value of the code segment; and determining, based on the return value, that the bounds of the buffer were exceeded during execution of the code segment.