Method and System for Finding Problems Caused by Access to Partially Uninitialized Data Storage Which is Accessed Using Index Expressions
AssigneeInternational Business Machines Corporation
InventorWolfgang Gellerich
Life of this patent
Estimating the term…
Abstract
The present invention provides a system and method for detecting problems caused by access to incompletely initialized data storage in assembler and high-level language programs. An internal representation of the control flow of the source code of the assembler program is generated and a data-flow analysis method is applied to the internal representation.
Claims17
Method for detecting problems caused by access to incompletely initialized data storage in assembler programs comprising:
- generating an internal representation of control flow of the source code of the assembler program by using standard techniques of compiler constructions, wherein said internal representation contains nodes for every statement found in said source code and a directed edge for every possible flow of control between said nodes;
- attributing data attributes to said nodes and/or said edges, wherein said data attributes are used to store the information which bits within the data storage can be guaranteed to be initialized;
- applying a data-flow analysis method to said internal representation of the control flow of the source code for determining which bits of the data storage can be guaranteed to be initialized;
- checking for each node whether the instruction reads bits that are not guaranteed to be initialized;
- and
- taking an appropriate action in order to overcome said problem.
A system for detecting problems caused by access to incompletely initialized data storage in assembler programs, the system being adapted to perform a method comprising:
- generating an internal representation of control flow of the source code of the program by using standard techniques of compiler constructions, wherein said internal representation contains nodes for every statement found in said source code and a directed edge for every possible flow of control between nodes;
- attributing data attributes to said nodes and/or said edges, wherein said data attributes are used to store the set of numbers identifying which bits within the memory area can be guaranteed to be initialized;
- applying a data-flow analysis method to said internal representation of the control flow of the source code for determining the set of bits of the memory area can be guaranteed to be initialized;
- checking for each node whether the instruction reads bits that are not guaranteed to be initialized;
- and
- taking an appropriate action in order to overcome said problem.
System according to 12, wherein said internal representation of said control flow of the source code is represented in a form of control flow graph, wherein said nodes in control flow graph may represent basic blocks which summarize the sequence of statements which will be executed by said control flow in a linear sequence.
An article of manufacture comprising:
- at least one computer usable medium having computer readable program code logic to detect problems caused by access to incompletely initialized data storage in assembler programs, said computer readable program code logic when executing performing the following:
- generating an internal representation of control flow of the source code of the assembler program by using standard techniques of compiler constructions, wherein said internal representation contains nodes for every statement found in said source code and a directed edge for every possible flow of control between said nodes;
- attributing data attributes to said nodes and/or said edges, wherein said data attributes are used to store the information which bits within the data storage can be guaranteed to be initialized;
- applying a data-flow analysis method to said internal representation of the control flow of the source code for determining which bits of the data storage can be guaranteed to be initialized;
- checking for each node whether the instruction reads bits that are not guaranteed to be initialized;
- and
- taking an appropriate action in order to overcome said problem.
Dependencies are inferred from the claim text.