[Prev][Next][Index]

DEREF_OP's type()




Hi,
 
  When I was checking the type in SgExpression, I notice that
the type for node with DEREF_OP is not quite right while the type
for node with ADDRSS_OP is right.
 
  I have print out some information via expression link for this
code,
 
void foo()
{
  int a;
  int * b;
  int * * c;
 
  a= *b;
  a= *(*c);
  b= & a;
  c= &(&a);
  c= &b;
}
This set is okay,
 
#23 variant:VAR_REF
=>b          id: 5 scope: 2
variant:VARIABLE_NAME
fulltype :T_POINTER  of base- fulltype :T_INT
 
#24 variant:VAR_REF
=>a          id: 4 scope: 2
variant:VARIABLE_NAME
fulltype :T_INT
 
#25 variant:ADDRESS_OP
=>&(a)          no symbol
fulltype :T_POINTER  of base- fulltype :T_INT
 
#26 variant:ASSGN_OP
=>b = &(a)          no symbol
fulltype :T_POINTER  of base- fulltype :T_INT
 
#27 variant:EXPR_LIST
=>b = &(a)          no symbol
fulltype :T_POINTER  of base- fulltype :T_INT
 
 
This set is not okay, but by the time it reaches the ASSGN_OP,
the type is correct again
 
#11 variant:VAR_REF
=>a          id: 4 scope: 2
variant:VARIABLE_NAME
fulltype :T_INT
 
#12 variant:VAR_REF
=>b          id: 5 scope: 2
variant:VARIABLE_NAME
fulltype :T_POINTER  of base- fulltype :T_INT
 
#13 variant:DEREF_OP
=>*b          no symbol
fulltype :T_POINTER  of base- fulltype :T_POINTER  of base- fulltype :T_INT
 
#14 variant:ASSGN_OP
=>a = *b          no symbol
fulltype :T_INT
 
#15 variant:EXPR_LIST
=>a = *b          no symbol
fulltype :T_INT
 
 
mei