diff --git a/arch/X86/X86IntelInstPrinter.c b/arch/X86/X86IntelInstPrinter.c index a248fcfe..244f4547 100644 --- a/arch/X86/X86IntelInstPrinter.c +++ b/arch/X86/X86IntelInstPrinter.c @@ -488,7 +488,6 @@ void X86_Intel_printInst(MCInst *MI, SStream *O, void *Info) MI->flat_insn->detail->x86.operands[0].size = MI->csh->regsize_map[reg]; MI->flat_insn->detail->x86.op_count++; } - } } diff --git a/arch/X86/X86Mapping.c b/arch/X86/X86Mapping.c index af9717d7..faf11af5 100644 --- a/arch/X86/X86Mapping.c +++ b/arch/X86/X86Mapping.c @@ -42561,17 +42561,21 @@ bool X86_lockrep(MCInst *MI, SStream *O) void op_addReg(MCInst *MI, int reg) { - MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].type = X86_OP_REG; - MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].reg = reg; - MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].size = MI->csh->regsize_map[reg]; - MI->flat_insn->detail->x86.op_count++; + if (MI->csh->detail) { + MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].type = X86_OP_REG; + MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].reg = reg; + MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].size = MI->csh->regsize_map[reg]; + MI->flat_insn->detail->x86.op_count++; + } } void op_addImm(MCInst *MI, int v) { - MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].type = X86_OP_IMM; - MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].imm = v; - MI->flat_insn->detail->x86.op_count++; + if (MI->csh->detail) { + MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].type = X86_OP_IMM; + MI->flat_insn->detail->x86.operands[MI->flat_insn->detail->x86.op_count].imm = v; + MI->flat_insn->detail->x86.op_count++; + } } #endif