Fixed '&function' and '&array'.

This commit is contained in:
acqn
2020-07-17 15:10:27 +08:00
committed by Oliver Schmidt
parent d23b577331
commit 9198b3be00

View File

@@ -1841,10 +1841,13 @@ void hie10 (ExprDesc* Expr)
/* Do it anyway, just to avoid further warnings */ /* Do it anyway, just to avoid further warnings */
Expr->Flags &= ~E_BITFIELD; Expr->Flags &= ~E_BITFIELD;
} }
Expr->Type = PointerTo (Expr->Type); /* It's allowed in C to take the address of an array this way */
if (!IsTypeFunc (Expr->Type) && !IsTypeArray (Expr->Type)) {
/* The & operator yields an rvalue address */ /* The & operator yields an rvalue address */
ED_AddrExpr (Expr); ED_AddrExpr (Expr);
} }
Expr->Type = PointerTo (Expr->Type);
}
break; break;
case TOK_SIZEOF: case TOK_SIZEOF: