mirror of
https://github.com/cc65/cc65.git
synced 2025-01-16 13:31:16 +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:
parent
a4a1c729c8
commit
37157a31a8
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user