mirror of
https://github.com/cc65/cc65.git
synced 2024-07-05 21:29:03 +00:00
Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@550 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
cd6f591d11
commit
0ab45f63f0
@ -198,8 +198,8 @@ unsigned assignadjust (type* lhst, struct expent* rhs)
|
|||||||
* set to the type of the left hand side.
|
* set to the type of the left hand side.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
/* Get the type of the right hand side. Treat function types as
|
/* Get the type of the right hand side. Treat function types as
|
||||||
* pointer-to-function
|
* pointer-to-function
|
||||||
*/
|
*/
|
||||||
type* rhst = rhs->e_tptr;
|
type* rhst = rhs->e_tptr;
|
||||||
if (IsTypeFunc (rhst)) {
|
if (IsTypeFunc (rhst)) {
|
||||||
@ -1316,11 +1316,12 @@ static void pre_incdec (struct expent* lval, void (*inc) (unsigned, unsigned lon
|
|||||||
g_subeqstatic (flags, lval->e_const, 0, val);
|
g_subeqstatic (flags, lval->e_const, 0, val);
|
||||||
}
|
}
|
||||||
} else if (lval->e_flags & E_MEXPR) {
|
} else if (lval->e_flags & E_MEXPR) {
|
||||||
/* Address in a/x. */
|
/* Address in a/x, check if we have an offset */
|
||||||
|
unsigned Offs = (lval->e_flags == E_MEOFFS)? lval->e_const : 0;
|
||||||
if (inc == g_inc) {
|
if (inc == g_inc) {
|
||||||
g_addeqind (flags, lval->e_const, val);
|
g_addeqind (flags, Offs, val);
|
||||||
} else {
|
} else {
|
||||||
g_subeqind (flags, lval->e_const, val);
|
g_subeqind (flags, Offs, val);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Internal ("Invalid addressing mode");
|
Internal ("Invalid addressing mode");
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#define E_MLOCAL 0x0040 /* Reference to local variable (stack offset) */
|
#define E_MLOCAL 0x0040 /* Reference to local variable (stack offset) */
|
||||||
#define E_MCONST 0x0020 /* Constant value */
|
#define E_MCONST 0x0020 /* Constant value */
|
||||||
#define E_MEXPR 0x0010 /* Result is in primary register */
|
#define E_MEXPR 0x0010 /* Result is in primary register */
|
||||||
#define E_MEOFFS 0x0011 /* Offset is in primary register, base on stack */
|
#define E_MEOFFS 0x0011 /* Base is in primary register, const offset */
|
||||||
|
|
||||||
#define E_MCTYPE 0x0007 /* Type of a constant */
|
#define E_MCTYPE 0x0007 /* Type of a constant */
|
||||||
#define E_TCONST 0x0000 /* Constant */
|
#define E_TCONST 0x0000 /* Constant */
|
||||||
|
Loading…
Reference in New Issue
Block a user