From ab7e9f84241c6f686999eb61069273c27dc0add5 Mon Sep 17 00:00:00 2001 From: acqn Date: Tue, 8 Sep 2020 21:36:38 +0800 Subject: [PATCH] Hotfix for Issue #1250. --- src/cc65/expr.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index e1b22ac50..826e72b09 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1933,13 +1933,6 @@ void hie10 (ExprDesc* Expr) case TOK_STAR: NextToken (); ExprWithCheck (hie10, Expr); - if (ED_IsLVal (Expr) || !ED_IsLocQuasiConst (Expr)) { - /* Not a const, load the pointer into the primary and make it a - ** calculated value. - */ - LoadExpr (CF_NONE, Expr); - ED_FinalizeRValLoad (Expr); - } /* If the expression is already a pointer to function, the ** additional dereferencing operator must be ignored. A function @@ -1951,6 +1944,14 @@ void hie10 (ExprDesc* Expr) /* Expression not storable */ ED_MarkExprAsRVal (Expr); } else { + if (!ED_IsQuasiConstAddr (Expr)) { + /* Not a constant address, load the pointer into the primary + ** and make it a calculated value. + */ + LoadExpr (CF_NONE, Expr); + ED_FinalizeRValLoad (Expr); + } + if (IsClassPtr (Expr->Type)) { Expr->Type = Indirect (Expr->Type); } else {