12.3.3 Precise rules for determining definite

王朝other·作者佚名  2006-01-10
窄屏简体版  字體: |||超大  

12.3.3 Precise rules for determining definite assignment

In order to determine that each used variable is definitely assigned, the

compiler must use a process that is

equivalent to the one described in this section.

The compiler processes the body of each function member that has one or

more initially unassigned

variables. For each initially unassigned variable v, the compiler

determines a definite assignment state for v

at each of the following points in the function member:

?At the beginning of each statement

?At the end point (?5.1) of each statement

?On each arc which transfers control to another statement or to the end

point of a statement

?At the beginning of each expression

?At the end of each expression

The definite assignment state of v can be either:

?Definitely assigned. This indicates that on all possible control flows

to this point, v has been

assigned a value.

?Not definitely assigned. For the state of a variable at the end of an

expression of type bool, the state

of a variable that isn.t definitely assigned may (but doesn.t necessarily)

fall into one of the

following sub-states:

o Definitely assigned after true expression. This state indicates that v

is definitely assigned if

the boolean expression evaluated as true, but is not necessarily assigned

if the boolean

expression evaluated as false.

o Definitely assigned after false expression. This state indicates that v

is definitely assigned if

the boolean expression evaluated as false, but is not necessarily assigned

if the boolean

expression evaluated as true.

The following rules govern how the state of a variable v is determined at

each location.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有  導航