Use new_binary_expr to recreate the assignment.

assign_expr mangles the destination expression for dereferenced
assignments into something that is invalid as an lvalue, so simply use
new_binary_expr with the same opcode.
This commit is contained in:
Bill Currie 2012-12-24 20:12:56 +09:00
parent 0fc8aa54e1
commit 9d27764576

View file

@ -1195,7 +1195,8 @@ convert_bool (expr_t *e, int block)
src = e->e.expr.e2; src = e->e.expr.e2;
if (src->type == ex_block) { if (src->type == ex_block) {
src = new_temp_def_expr (get_type (src)); src = new_temp_def_expr (get_type (src));
e = assign_expr (e->e.expr.e1, assign_expr (src, e->e.expr.e2)); e = new_binary_expr (e->e.expr.op, e->e.expr.e1,
assign_expr (src, e->e.expr.e2));
} }
b = convert_bool (src, 1); b = convert_bool (src, 1);
if (b->type == ex_error) if (b->type == ex_error)