This change required refactoring the address offset used in Sleigh from usize to u64. This was likely a poor decision to begin with, since on 32-bit architectures the choice of usize could result in information loss outright. If however usize were larger, e.g. u128, then the offset conversion would fail to preserve negative offset information. Forcing the interpretation of this value as i64 felt awkward, whereas if its a u64 then an i64 interpretation is natural.
It also required changing the return type for the emulate function to handle branching to both absolute machine addresses as well as p-code relative offsets. This enum also supports the concept of conditional branching, which will be used by the CBRANCH instruction.
This change required refactoring the address offset used in Sleigh from
usize
tou64
. This was likely a poor decision to begin with, since on 32-bit architectures the choice ofusize
could result in information loss outright. If howeverusize
were larger, e.g.u128
, then the offset conversion would fail to preserve negative offset information. Forcing the interpretation of this value asi64
felt awkward, whereas if its au64
then ani64
interpretation is natural.It also required changing the return type for the
emulate
function to handle branching to both absolute machine addresses as well as p-code relative offsets. This enum also supports the concept of conditional branching, which will be used by theCBRANCH
instruction.Closes #9