cleanup
This commit is contained in:
parent
ec3705d8fd
commit
e1494cf1f4
|
@ -922,18 +922,14 @@ bool X86_getInstruction(csh ud, const uint8_t *code, size_t code_len,
|
||||||
if (instr->flat_insn->detail) {
|
if (instr->flat_insn->detail) {
|
||||||
// instr->flat_insn->detail initialization: 3 alternatives
|
// instr->flat_insn->detail initialization: 3 alternatives
|
||||||
|
|
||||||
|
|
||||||
// 1. The whole structure, this is how it's done in other arch disassemblers
|
// 1. The whole structure, this is how it's done in other arch disassemblers
|
||||||
// Probably overkill since cs_detail is huge because of the 36 operands of ARM
|
// Probably overkill since cs_detail is huge because of the 36 operands of ARM
|
||||||
|
|
||||||
//memset(instr->flat_insn->detail, 0, sizeof(cs_detail));
|
//memset(instr->flat_insn->detail, 0, sizeof(cs_detail));
|
||||||
|
|
||||||
|
|
||||||
// 2. Only the part relevant to x86
|
// 2. Only the part relevant to x86
|
||||||
|
|
||||||
memset(instr->flat_insn->detail, 0, offsetof(cs_detail, x86) + sizeof(cs_x86));
|
memset(instr->flat_insn->detail, 0, offsetof(cs_detail, x86) + sizeof(cs_x86));
|
||||||
|
|
||||||
|
|
||||||
// 3. The relevant part except for x86.operands
|
// 3. The relevant part except for x86.operands
|
||||||
// sizeof(cs_x86) is 0x1c0, sizeof(x86.operands) is 0x180
|
// sizeof(cs_x86) is 0x1c0, sizeof(x86.operands) is 0x180
|
||||||
// marginally faster, should be okay since x86.op_count is set to 0
|
// marginally faster, should be okay since x86.op_count is set to 0
|
||||||
|
|
Loading…
Reference in New Issue