Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X86Operand uses Option<RegAccessType> for specifying the access types of memory operands #135

Open
jrmuizel opened this issue Sep 13, 2022 · 2 comments
Assignees

Comments

@jrmuizel
Copy link

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.

@jrmuizel
Copy link
Author

Maybe just renaming the type to AccessType is a good solution?

@tmfink
Copy link
Member

tmfink commented Oct 16, 2023

Maybe just renaming the type to AccessType is 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.

@tmfink tmfink self-assigned this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants