# US 2008/0307398 A1 · Method and System for Finding Problems Caused by Access to Partially Uninitialized Data Storage Which is Accessed Using Index Expressions

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0307398 A1
- Document ID: US20080307398A1
- Status: Published application
- Kind: A1
- Application number: 12/130,094
- Filed: 2008-05-30
- Published: 2008-12-11
- Earliest claimed: 2007-06-05
- Assignees: International Business Machines Corporation
- Inventors: Wolfgang Gellerich
- Web page: https://patentgrep.com/patent/US20080307398A1

## CPC

- G06F 11/366: {using diagnostics (G06F11/0703 takes precedence)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## 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.

## Claims

### Claim 1

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.

### Claim 2 (depends on 1)

Method according to claim 1, wherein said applying comprises:
initializing all of said attributes of said internal representation of the control flow of the source code with an initial value;
providing access to the set of numbers denoting bits read by said statement associated to said node, the set of number identifying the bits written by said statement, and all attributes of the nodes from which a directed edge to said node for the attribute is currently being calculated;
calculating for each of said nodes a value for said attribute associated to said node based on said parameters; and
repeating said calculating until for all attributes the newly computed value remains unchanged.

### Claim 3 (depends on 2)

Method according to claim 2, 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 said 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.

### Claim 4 (depends on 2)

Method according to claim 2, wherein said internal representation of said control flow of said source code is constructed according to the principles of static single assignment form.

### Claim 5 (depends on 2)

Method according to claim 2, wherein said initial value of said attribute is the empty set.

### Claim 6 (depends on 2)

Method according to claim 2, wherein said calculation is based of the value for each data attribute D associated with each node n is performed by evaluating the assignment D=in (n) where function in is given as
i


n

(
n
)
=
{
0
if


n


is


the


entry
∏
p
∈
PRED

(
n
)

F
inst_p

(
i


n

(
p
)
)
otherwise
(
3
)
and the flow function F is given as
F
inst

(
D
)
=
{
D
⋃
{
i
,
…

,
j
}
if


inst


sets


bits


number


i


to


j
within


memory


area


M
D
otherwise
(
2
)

### Claim 7 (depends on 2)

Method according to claim 2, wherein said action to be taken is to display the instructions erroneously access to the partially initialized memory area to user by means of a user interface.

### Claim 8 (depends on 7)

Method according to claim 7, wherein said access to an only partly initialized memory area is displayed by the line number of the statement.

### Claim 9 (depends on 2)

Method according to claim 2, wherein said calculation of said values additionally records which statement is the reason why certain bits of the respective memory area are not initialized and provides that information in addition to the report of the accesses to the only partly initialized memory area.

### Claim 10 (depends on 2)

Method according to claim 2, wherein initialization performed upon program start or by another part of the program is taken as an additional input to step C2.

### Claim 11

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.

### Claim 12 (depends on 11)

System according to claim 11 wherein said applying comprises:
initializing all of said attributes of said internal representation of the control flow of the source code with an initial value;
providing access to the set of numbers denoting bits read by said statement associated to said node, the set of number identifying the bits written by said statement, and all attributes of the nodes from which a directed edge to said node for the attribute is currently being calculated;
calculating for each of said nodes a value for said attribute associated to said node based on said parameters; and
repeating calculating step until for all attributes the newly computed value remains unchanged.

### Claim 13

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.

### Claim 14 (depends on 12)

System according to claim 12, wherein said internal representation of said control flow of said source code is constructed according to the principles of static single assignment form.

### Claim 15 (depends on 12)

System according to claim 12, wherein said initial value of said attribute is the empty set.

### Claim 16

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.

### Claim 17 (depends on 16)

The article of manufacture of claim 16, wherein the applying comprises:
initializing all of said attributes of said internal representation of the control flow of the source code with an initial value;
providing access to the set of numbers denoting bits read by said statement associated to said node, the set of number identifying the bits written by said statement, and all attributes of the nodes from which a directed edge to said node for the attribute is currently being calculated;
calculating for each of said nodes a value for said attribute associated to said node based on said parameters; and
repeating said calculating until for all attributes the newly computed value remains unchanged.
