Fix disassembler not advancing past PC

This commit is contained in:
2024-11-01 15:01:09 -05:00
parent ae22c95dbe
commit 53826584b8
3 changed files with 21 additions and 3 deletions
+2 -2
View File
@@ -511,7 +511,7 @@ static int dasmLine(VB *sim, uint32_t *address, uint32_t pc,
line->isPC = *address == pc;
for (x = 0; x < line->codeLength; x++)
line->code[x] = vbRead(sim, *address + x, VB_U8);
*address += pc - *address < line->codeLength ?
*address += pc != *address && pc - *address < line->codeLength ?
pc - *address : line->codeLength;
/* Do not process text members */
@@ -655,7 +655,7 @@ static VBU_DasmLine* dasmDisassemble(VB *sim, uint32_t address,
size = dasmInstSize(sim, addr);
if (address - addr < size)
break;
addr += pc - addr < size ? pc - addr : size;
addr += addr != pc && pc - addr < size ? pc - addr : size;
}
/* Address of first line is in the circular buffer */