Stricter check for incax[1-8]

Thanks to @kugelfuhr

Co-authored-by: kugelfuhr <98353208+kugelfuhr@users.noreply.github.com>
This commit is contained in:
Colin Leroy-Mira
2025-07-20 18:48:58 +02:00
committed by GitHub
parent fa1b6ed4f7
commit 6d96a952fd

View File

@@ -517,7 +517,8 @@ unsigned OptAXLoad (CodeSeg* S)
/* Check for incax[1-8] followed by jsr/jmp ldaxi */ /* Check for incax[1-8] followed by jsr/jmp ldaxi */
if (E->OPC == OP65_JSR && if (E->OPC == OP65_JSR &&
strncmp (E->Arg, "incax", 5) == 0 && strncmp (E->Arg, "incax", 5) == 0 &&
strcmp (E->Arg, "incaxy") != 0 && E->Arg[5] >= '1' && E->Arg[5] <= '8' &&
E->Arg[6] == '\0' &&
(N = CS_GetNextEntry (S, I)) != 0 && (N = CS_GetNextEntry (S, I)) != 0 &&
(N->OPC == OP65_JSR || N->OPC == OP65_JMP) && (N->OPC == OP65_JSR || N->OPC == OP65_JMP) &&
strcmp (N->Arg, "ldaxi") == 0 && strcmp (N->Arg, "ldaxi") == 0 &&