From: cuz Date: Tue, 1 Jun 2004 20:30:44 +0000 (+0000) Subject: Fixed a bug X-Git-Tag: V2.12.0~765 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d8f738409178f85e75448cfc21108a4ae2b6c393;p=cc65 Fixed a bug git-svn-id: svn://svn.cc65.org/cc65/trunk@3066 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/codeopt.c b/src/cc65/codeopt.c index cb91bb380..7d1109a6f 100644 --- a/src/cc65/codeopt.c +++ b/src/cc65/codeopt.c @@ -552,16 +552,20 @@ static unsigned OptPtrStore1 (CodeSeg* S) /* Delete the old code */ CS_DelEntry (S, I+7+K); /* jsr spaspidx */ CS_DelEntry (S, I+2); /* jsr ldauidx */ - CS_DelEntry (S, I); /* jsr pushax */ /* Create and insert the stores into the zp pointer if needed */ if (RegBank == 0) { X = NewCodeEntry (OP65_STA, AM65_ZP, "ptr1", 0, L[0]->LI); - CS_InsertEntry (S, X, I); - X = NewCodeEntry (OP65_STX, AM65_ZP, "ptr1+1", 0, L[0]->LI); CS_InsertEntry (S, X, I+1); + X = NewCodeEntry (OP65_STX, AM65_ZP, "ptr1+1", 0, L[0]->LI); + CS_InsertEntry (S, X, I+2); } + /* Delete more old code. Do it here to keep a label attached to + * entry I in place. + */ + CS_DelEntry (S, I); /* jsr pushax */ + /* Remember, we had changes */ ++Changes;