From a0b705fd4194875f839d9f249723ddde4634c925 Mon Sep 17 00:00:00 2001 From: Colin Leroy-Mira Date: Sun, 20 Jul 2025 15:22:59 +0200 Subject: [PATCH] Remove code after inserting new one --- src/cc65/coptmisc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc65/coptmisc.c b/src/cc65/coptmisc.c index 0e3dd0d56..e21234cd1 100644 --- a/src/cc65/coptmisc.c +++ b/src/cc65/coptmisc.c @@ -1226,15 +1226,15 @@ unsigned OptTosPushPop(CodeSeg *S) strcmp(N->Arg, "popax") == 0 && !CE_HasLabel (N)) { - /* Delete the old code */ - CS_DelEntries (S, I, 2); - /* Insert an rts if jmp popax */ if (N->OPC == OP65_JMP) { CodeEntry* X = NewCodeEntry (OP65_RTS, AM65_IMP, 0, 0, E->LI); CS_InsertEntry (S, X, I); } + /* Delete the old code */ + CS_DelEntries (S, I+1, 2); + /* Regenerate register info */ CS_GenRegInfo (S);