[Prev][Next][Index]

Un-expected behavior of lhs ()/rhs () for SgExpression.




When S points to i=10, I get the following output

i = 10
i
10
i = 10
i = 10
i
10
i = 10
i
10

For the following statements

isSgExprListExp(S->expr(0))->value()->unparsestdout (); printf ("\n");
isSgExprListExp(S->expr(0))->value()->lhs()->unparsestdout (); printf ("\n");
isSgExprListExp(S->expr(0))->value()->rhs()->unparsestdout (); printf ("\n");

S->expr(0)->unparsestdout(); printf ("\n");
S->expr(0)->lhs()->unparsestdout(); printf ("\n");
S->expr(0)->lhs()->lhs()->unparsestdout(); printf ("\n");
S->expr(0)->lhs()->rhs()->unparsestdout(); printf ("\n");

isSgCExpStmt (S)->expr()->lhs()->unparsestdout(); printf ("\n");
isSgCExpStmt (S)->expr()->lhs()->lhs()->unparsestdout(); printf ("\n");
isSgCExpStmt (S)->expr()->lhs()->rhs()->unparsestdout(); printf ("\n");

The following statements generated a segmentation fault

S->expr(0)->rhs()->unparsestdout(); printf ("\n");
isSgCExpStmt (S)->expr()->rhs()->unparsestdout(); printf ("\n");

Rahul