[Prev][Next][Index]

Size expression in a new operator.




For the following SgCExpStmt I could not get a pointer to the expression (in []
brackets) that specifies size for the new expression.

      w = (precision) new precisionType[PrecisionSize + sizeof(digit) * size];

For E pointing to the rhs () of the above expression, I got a pointer F to the
new expression with E->operand (1); this strips the cast expression from the
rhs (). F->operand(1) gave me the cast expression following new. However,
F->operand(1)->operand(1) did not strip the cast and give the desired
expression; I got a segmentation fault for this expression.

Rahul