From 6d96a952fd1b7f3d970299053f5a05c3e82636a2 Mon Sep 17 00:00:00 2001 From: Colin Leroy-Mira Date: Sun, 20 Jul 2025 18:48:58 +0200 Subject: [PATCH] Stricter check for incax[1-8] Thanks to @kugelfuhr Co-authored-by: kugelfuhr <98353208+kugelfuhr@users.noreply.github.com> --- src/cc65/coptmisc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cc65/coptmisc.c b/src/cc65/coptmisc.c index 3680a33ab..f52999285 100644 --- a/src/cc65/coptmisc.c +++ b/src/cc65/coptmisc.c @@ -517,7 +517,8 @@ unsigned OptAXLoad (CodeSeg* S) /* Check for incax[1-8] followed by jsr/jmp ldaxi */ if (E->OPC == OP65_JSR && 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->OPC == OP65_JSR || N->OPC == OP65_JMP) && strcmp (N->Arg, "ldaxi") == 0 &&