1
0
mirror of https://github.com/cc65/cc65.git synced 2024-08-20 09:29:12 +00:00

Fixed several dangling pointer bugs in 65C0 2optimizations

git-svn-id: svn://svn.cc65.org/cc65/trunk@587 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-12-24 14:37:18 +00:00
parent 45de0a49ec
commit 51e5a7cf84

View File

@ -3635,14 +3635,13 @@ static void OptBitOps (void)
/* Replace by trb */
ReplaceLine (L, "\tlda\t#$%02X", (~Val) & 0xFF);
ReplaceLine (L2[0], "\ttrb\t%s", L2[1]->Line+5);
L = ReplaceLine (L2[0], "\ttrb\t%s", L2[1]->Line+5);
FreeLine (L2[1]);
L = L2[0];
} else {
/* Just reorder */
L = ReplaceLine (L, "\tlda\t#$%02X", Val);
ReplaceLine (L, "\tlda\t#$%02X", Val);
ReplaceLine (L2[0], "\tand\t%s", L2[1]->Line+5);
L = L2[1];
@ -3660,7 +3659,7 @@ static void OptBitOps (void)
/* ORA with 0xFF, replace by a store of $FF */
FreeLine (L);
ReplaceLine (L2[0], "\tlda\t#$FF");
L = ReplaceLine (L2[0], "\tlda\t#$FF");
} else if (CPU == CPU_65C02 &&
!IsXAddrMode (L) &&
@ -3669,14 +3668,13 @@ static void OptBitOps (void)
/* Replace by trb */
ReplaceLine (L, "\tlda\t#$%02X", Val);
ReplaceLine (L2[0], "\ttsb\t%s", L2[1]->Line+5);
L = ReplaceLine (L2[0], "\ttsb\t%s", L2[1]->Line+5);
FreeLine (L2[1]);
L = L2[0];
} else {
/* Just reorder */
L = ReplaceLine (L, "\tlda\t#$%02X", Val);
ReplaceLine (L, "\tlda\t#$%02X", Val);
ReplaceLine (L2[0], "\tora\t%s", L2[1]->Line+5);
L = L2[1];