Remove code after inserting new one

This commit is contained in:
Colin Leroy-Mira
2025-07-20 15:22:59 +02:00
parent 0647cb1112
commit a0b705fd41

View File

@@ -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);