fix code off -> instruction idx lookup - fixes busted instruction pointer drawing in disassembly view

This commit is contained in:
Ryan Fleury
2024-05-29 08:03:06 -07:00
parent 5778e75d66
commit f65cf5436e
+2 -1
View File
@@ -69,7 +69,8 @@ dasm_inst_array_idx_from_code_off__linear_scan(DASM_InstArray *array, U64 off)
U64 result = 0;
for(U64 idx = 0; idx < array->count; idx += 1)
{
if(array->v[idx].code_off == off)
U64 next_off = (idx+1 < array->count ? array->v[idx+1].code_off : max_U64);
if(array->v[idx].code_off <= off && off < next_off)
{
result = idx;
break;