X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fcoptptrload.c;fp=src%2Fcc65%2Fcoptptrload.c;h=78905d8d58ccad9d32cbe43fcb4f91ae58afaf67;hb=cff1a6ffdb699537577df8c2ff78b4b4f98f3f63;hp=1e4b152d5e5d0cd7e1baca829b2467c4e9d388f6;hpb=61c1f6b27055f3ddba68d3fdc3abee0c70820c27;p=cc65 diff --git a/src/cc65/coptptrload.c b/src/cc65/coptptrload.c index 1e4b152d5..78905d8d5 100644 --- a/src/cc65/coptptrload.c +++ b/src/cc65/coptptrload.c @@ -1247,16 +1247,14 @@ unsigned OptPtrLoad15 (CodeSeg* S) /* Walk over the entries */ unsigned I = 0; - while (I < CS_GetEntryCount (S) - 3) { + while (I < CS_GetEntryCount (S)) { CodeEntry* L[5]; unsigned Len; - /* Get next 3 entries */ - CS_GetEntries (S, L, I, 3); - /* Check for the start of the sequence */ - if (L[0]->OPC == OP65_LDA && L[0]->AM == AM65_ZP && + if (CS_GetEntries (S, L, I, 3) && + L[0]->OPC == OP65_LDA && L[0]->AM == AM65_ZP && L[1]->OPC == OP65_LDX && L[1]->AM == AM65_ZP && !CS_RangeHasLabel (S, I+1, 2) && (Len = strlen (L[0]->Arg)) > 0 &&