capstone-rs
capstone-rs copied to clipboard
`X86Operand` uses `Option<RegAccessType>` for specifying the access types of memory operands
I found it confusing that RegAccessType is used. It sort of implies that it describes how the register is accessed and not the memory.
e.g.:
0x1000: addl $1, (%rdi)
insn id: 8
bytes: [131, 7, 1]
read regs:
write regs: rflags
insn groups:
operands: 2
X86Operand(X86Operand { size: 4, access: None, avx_bcast: X86_AVX_BCAST_INVALID, avx_zero_opmask: false, op_type: Imm(1) })
X86Operand(X86Operand { size: 4, access: Some(ReadWrite), avx_bcast: X86_AVX_BCAST_INVALID, avx_zero_opmask: false, op_type: Mem(X86OpMem(x86_op_mem { segment: 0, base: 39, index: 0, scale: 1, disp: 0 })) })
The second operand has access: Some(ReadWrite) but that's not describing how rdi is accessed.
Maybe just renaming the type to AccessType is a good solution?
Maybe just renaming the type to
AccessTypeis a good solution?
I agree--that makes sense to me. The C type is name cs_ac_type, which does not imply anything about access to registers.