aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/cgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/cgen.c')
-rw-r--r--bootstrap/cgen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c
index 5fae699..e4ba1fd 100644
--- a/bootstrap/cgen.c
+++ b/bootstrap/cgen.c
@@ -246,7 +246,10 @@ genexpr(struct expr *ex) {
pri(")");
break;
case Eas:
- pri("((%t)%e)", ex->ty, ex->child);
+ if (ex->ty->t != TYarr)
+ pri("((%t)%e)", ex->ty, ex->child);
+ else
+ pri("(%e)", ex->child);
break;
case Eenumval:
pri("/*%s:%s*/", ex->ty->enu.name, ex->enu.vname);
@@ -341,7 +344,7 @@ genstmt(struct blockstmt *block, struct stmt *stmt) {
&& (decl.var.ini->t == Ezeroini || decl.var.ini->t == Eini))
{
geniniex(decl.var.ini);
- } else if (decl.var.ty->t == TYeunion) {
+ } else if (decl.var.ini->t == Eeuini) {
geneuiniex(decl.var.ini);
} else {
pri("%e", decl.var.ini);