On 11/07/2011 11:31 AM, Richard Henderson wrote:
On 11/07/2011 06:12 AM, Torvald Riegel wrote:
stmt = begin_transaction_stmt (input_location, NULL, flags);
tmp = RECUR (TRANSACTION_EXPR_BODY (t));
+ if (tmp)
+ {
+ /* No statements; handle this like an expression. */
In which case I'm pretty sure you ought to check for non-null
TRANSACTION_EXPR_BODY first and not call begin_transaction_stmt.
I believe TRANSACTION_EXPR_BODY is always non-null, but when tsubst_expr
is called for a statement it adds the new statement via add_stmt and
returns null. This approach is a bit funny, but ought to work fine, and
there doesn't seem to be a simple test to distinguish between statements
and expressions currently.
Jason