Patent ID: 7328374

Claim:
A method in a processor in a data processing system for checking assertions, the method comprising: responsive to a directive in program source code indicating that metadata for validating assertions by hardware is required generating the metadata, by a compiler, wherein the directive indicates the metadata to be generated and wherein an assertion is a statement about a state of a program that is required to remain true during execution of the program responsive to detecting a change in data in a memory location, determining by the processor, whether the metadata for an assertion is associated with the memory location; responsive to the metadata being associated with the memory location, comparing by the processor, the data to the assertion; responsive to a determination that the assertion is invalid with respect to the data, generating, by the processor, an interrupt terminating execution of an instruction causing the data to make the assertion invalid wherein the processor checks the assertions for validity durin, execution of the program code at runtime and wherein an illegal operation is detected before the illegal operation occurs.