1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-16 09:29:32 +00:00

Fixed problems with R3977: While the solution was correct, the generated code

is bad, since information is lost when converting functions and arrays to
pointers and cannot be regained easily. So I've reverted the change and fixed
the problem in a less general manner.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3984 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2009-07-30 14:45:50 +00:00
parent a4a1c729c8
commit 37157a31a8
2 changed files with 3 additions and 5 deletions

View File

@ -2683,6 +2683,7 @@ static void hieQuest (ExprDesc* Expr)
/* Load it into the primary */
LoadExpr (CF_NONE, &Expr2);
ED_MakeRValExpr (&Expr2);
Expr2.Type = PtrConversion (Expr2.Type);
}
labt = GetLocalLabel ();
ConsumeColon ();
@ -2700,6 +2701,7 @@ static void hieQuest (ExprDesc* Expr)
/* Load it into the primary */
LoadExpr (CF_NONE, &Expr3);
ED_MakeRValExpr (&Expr3);
Expr3.Type = PtrConversion (Expr3.Type);
}
/* Check if any conversions are needed, if so, do them.
@ -2842,7 +2844,7 @@ static void opeq (const GenDesc* Gen, ExprDesc* Expr)
g_inc (flags | CF_CONST, Expr2.IVal);
} else if (Gen->Func == g_sub) {
g_dec (flags | CF_CONST, Expr2.IVal);
} else {
} else {
if (Expr2.IVal == 0) {
/* Check for div by zero/mod by zero */
if (Gen->Func == g_div) {

View File

@ -172,10 +172,6 @@ void LoadExpr (unsigned Flags, struct ExprDesc* Expr)
}
}
/* Do standard pointer conversions since the expression is now in the
* primary.
*/
Expr->Type = PtrConversion (Expr->Type);
}