@@ -275,17 +275,17 @@ static void printMemOffset(MCInst *MI, unsigned Op, SStream *O)
275
275
}
276
276
277
277
if (MI -> csh -> detail ) {
278
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].type = X86_OP_MEM ;
279
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .base = X86_REG_INVALID ;
280
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .index = X86_REG_INVALID ;
281
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .scale = 1 ;
282
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .disp = 0 ;
278
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].type = X86_OP_MEM ;
279
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .base = X86_REG_INVALID ;
280
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .index = X86_REG_INVALID ;
281
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .scale = 1 ;
282
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .disp = 0 ;
283
283
}
284
284
285
285
if (MCOperand_isImm (DispSpec )) {
286
286
int64_t imm = MCOperand_getImm (DispSpec );
287
287
if (MI -> csh -> detail )
288
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .disp = imm ;
288
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .disp = imm ;
289
289
if (imm < 0 ) {
290
290
SStream_concat (O , "0x%" PRIx64 , arch_masks [MI -> csh -> mode ] & imm );
291
291
} else {
@@ -299,7 +299,7 @@ static void printMemOffset(MCInst *MI, unsigned Op, SStream *O)
299
299
SStream_concat0 (O , markup (">" ));
300
300
301
301
if (MI -> csh -> detail )
302
- MI -> flat_insn . x86 .op_count ++ ;
302
+ MI -> flat_insn -> detail -> x86 .op_count ++ ;
303
303
}
304
304
305
305
static void printMemOffs8 (MCInst * MI , unsigned OpNo , SStream * O )
@@ -332,7 +332,7 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O)
332
332
{
333
333
MCOperand * Op = MCInst_getOperand (MI , OpNo );
334
334
if (MCOperand_isImm (Op )) {
335
- int64_t imm = MCOperand_getImm (Op ) + MI -> insn_size + MI -> address ;
335
+ int64_t imm = MCOperand_getImm (Op ) + MI -> flat_insn -> size + MI -> address ;
336
336
if (imm < 0 ) {
337
337
if (imm < - HEX_THRESHOLD )
338
338
SStream_concat (O , "-0x%" PRIx64 , - imm );
@@ -349,9 +349,9 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O)
349
349
SStream_concat (O , "%" PRIu64 , imm );
350
350
}
351
351
if (MI -> csh -> detail ) {
352
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].type = X86_OP_IMM ;
353
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].imm = imm ;
354
- MI -> flat_insn . x86 .op_count ++ ;
352
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].type = X86_OP_IMM ;
353
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].imm = imm ;
354
+ MI -> flat_insn -> detail -> x86 .op_count ++ ;
355
355
}
356
356
}
357
357
}
@@ -362,9 +362,9 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
362
362
if (MCOperand_isReg (Op )) {
363
363
printRegName (O , MCOperand_getReg (Op ));
364
364
if (MI -> csh -> detail ) {
365
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].type = X86_OP_REG ;
366
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].reg = MCOperand_getReg (Op );
367
- MI -> flat_insn . x86 .op_count ++ ;
365
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].type = X86_OP_REG ;
366
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].reg = MCOperand_getReg (Op );
367
+ MI -> flat_insn -> detail -> x86 .op_count ++ ;
368
368
}
369
369
} else if (MCOperand_isImm (Op )) {
370
370
// Print X86 immediates as signed values.
@@ -381,9 +381,9 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
381
381
SStream_concat (O , "%s$-%" PRIu64 "%s" , markup ("<imm:" ), - imm , markup (">" ));
382
382
}
383
383
if (MI -> csh -> detail ) {
384
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].type = X86_OP_IMM ;
385
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].imm = imm ;
386
- MI -> flat_insn . x86 .op_count ++ ;
384
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].type = X86_OP_IMM ;
385
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].imm = imm ;
386
+ MI -> flat_insn -> detail -> x86 .op_count ++ ;
387
387
}
388
388
}
389
389
}
@@ -420,11 +420,11 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
420
420
uint64_t ScaleVal ;
421
421
422
422
if (MI -> csh -> detail ) {
423
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].type = X86_OP_MEM ;
424
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .base = MCOperand_getReg (BaseReg );
425
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .index = MCOperand_getReg (IndexReg );
426
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .scale = 1 ;
427
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .disp = 0 ;
423
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].type = X86_OP_MEM ;
424
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .base = MCOperand_getReg (BaseReg );
425
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .index = MCOperand_getReg (IndexReg );
426
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .scale = 1 ;
427
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .disp = 0 ;
428
428
}
429
429
430
430
SStream_concat0 (O , markup ("<mem:" ));
@@ -438,7 +438,7 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
438
438
if (MCOperand_isImm (DispSpec )) {
439
439
int64_t DispVal = MCOperand_getImm (DispSpec );
440
440
if (MI -> csh -> detail )
441
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .disp = DispVal ;
441
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .disp = DispVal ;
442
442
if (DispVal || (!MCOperand_getReg (IndexReg ) && !MCOperand_getReg (BaseReg ))) {
443
443
if (DispVal < 0 ) {
444
444
SStream_concat (O , "0x%" PRIx64 , arch_masks [MI -> csh -> mode ] & DispVal );
@@ -462,7 +462,7 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
462
462
_printOperand (MI , Op + 2 , O );
463
463
ScaleVal = MCOperand_getImm (MCInst_getOperand (MI , Op + 1 ));
464
464
if (MI -> csh -> detail )
465
- MI -> flat_insn . x86 .operands [MI -> flat_insn . x86 .op_count ].mem .scale = (int )ScaleVal ;
465
+ MI -> flat_insn -> detail -> x86 .operands [MI -> flat_insn -> detail -> x86 .op_count ].mem .scale = (int )ScaleVal ;
466
466
if (ScaleVal != 1 ) {
467
467
SStream_concat (O , ", %s%u%s" , markup ("<imm:" ), ScaleVal , markup (">" ));
468
468
}
@@ -473,7 +473,7 @@ static void printMemReference(MCInst *MI, unsigned Op, SStream *O)
473
473
SStream_concat0 (O , markup (">" ));
474
474
475
475
if (MI -> csh -> detail )
476
- MI -> flat_insn . x86 .op_count ++ ;
476
+ MI -> flat_insn -> detail -> x86 .op_count ++ ;
477
477
}
478
478
479
479
#include "X86InstPrinter.h"
@@ -514,10 +514,10 @@ void X86_ATT_printInst(MCInst *MI, SStream *OS, void *info)
514
514
// add register operand
515
515
for (i = 0 ;; i ++ ) {
516
516
// find the first empty slot to put it there
517
- if (MI -> flat_insn . x86 .operands [i ].type == 0 ) {
518
- MI -> flat_insn . x86 .operands [i ].type = X86_OP_REG ;
519
- MI -> flat_insn . x86 .operands [i ].reg = reg ;
520
- MI -> flat_insn . x86 .op_count ++ ;
517
+ if (MI -> flat_insn -> detail -> x86 .operands [i ].type == 0 ) {
518
+ MI -> flat_insn -> detail -> x86 .operands [i ].type = X86_OP_REG ;
519
+ MI -> flat_insn -> detail -> x86 .operands [i ].reg = reg ;
520
+ MI -> flat_insn -> detail -> x86 .op_count ++ ;
521
521
break ;
522
522
}
523
523
}
0 commit comments