mirror of
https://github.com/cc65/cc65.git
synced 2025-08-14 14:26:27 +00:00
Fix type of "&array" - it will actually generate pointer to array, not pointer
to element. This will make some valid code work but emits now errors for questionable code. git-svn-id: svn://svn.cc65.org/cc65/trunk@3775 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -1547,11 +1547,8 @@ void hie10 (ExprDesc* Expr)
|
|||||||
/* The & operator may be applied to any lvalue, and it may be
|
/* The & operator may be applied to any lvalue, and it may be
|
||||||
* applied to functions, even if they're no lvalues.
|
* applied to functions, even if they're no lvalues.
|
||||||
*/
|
*/
|
||||||
if (ED_IsRVal (Expr) && !IsTypeFunc (Expr->Type)) {
|
if (ED_IsRVal (Expr) && !IsTypeFunc (Expr->Type) && !IsTypeArray (Expr->Type)) {
|
||||||
/* Allow the & operator with an array */
|
|
||||||
if (!IsTypeArray (Expr->Type)) {
|
|
||||||
Error ("Illegal address");
|
Error ("Illegal address");
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Expr->Type = PointerTo (Expr->Type);
|
Expr->Type = PointerTo (Expr->Type);
|
||||||
ED_MakeRVal (Expr);
|
ED_MakeRVal (Expr);
|
||||||
|
Reference in New Issue
Block a user