Support taking the address of block expressions that have a result.

This commit is contained in:
Bill Currie 2011-03-06 16:05:38 +09:00
parent 993d05b3d3
commit c78d15b331

View file

@ -2129,6 +2129,10 @@ address_expr (expr_t *e1, expr_t *e2, type_t *t)
return address_expr (e1->e.expr.e1, e2, t);
}
return error (e1, "invalid type for unary &");
case ex_block:
if (!e1->e.block.result)
return error (e1, "invalid type for unary &");
return address_expr (e1->e.block.result, e2, t);
default:
return error (e1, "invalid type for unary &");
}