Define ARO_COUNT for the amount of operands supported
This commit is contained in:
parent
936db21b44
commit
862be04125
|
@ -175,7 +175,8 @@ typedef struct _AsmArchInstructionCall
|
||||||
{
|
{
|
||||||
char const * prefix;
|
char const * prefix;
|
||||||
char const * name;
|
char const * name;
|
||||||
AsmArchOperand operands[5];
|
# define ARO_COUNT 5
|
||||||
|
AsmArchOperand operands[ARO_COUNT];
|
||||||
uint32_t operands_cnt;
|
uint32_t operands_cnt;
|
||||||
|
|
||||||
/* meta information */
|
/* meta information */
|
||||||
|
|
|
@ -522,7 +522,7 @@ static int _i386_encode(AsmArchPlugin * plugin,
|
||||||
AsmArchInstructionCall const * call)
|
AsmArchInstructionCall const * call)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
AsmArchOperandDefinition definitions[3];
|
AsmArchOperandDefinition definitions[ARO_COUNT];
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "DEBUG: %s(\"%s\")\n", __func__, instruction->name);
|
fprintf(stderr, "DEBUG: %s(\"%s\")\n", __func__, instruction->name);
|
||||||
|
@ -534,6 +534,8 @@ static int _i386_encode(AsmArchPlugin * plugin,
|
||||||
definitions[0] = instruction->op1;
|
definitions[0] = instruction->op1;
|
||||||
definitions[1] = instruction->op2;
|
definitions[1] = instruction->op2;
|
||||||
definitions[2] = instruction->op3;
|
definitions[2] = instruction->op3;
|
||||||
|
for(i = 3; i < sizeof(definitions) / sizeof(*definitions); i++)
|
||||||
|
definitions[i] = 0x0;
|
||||||
for(i = 0; i < call->operands_cnt; i++)
|
for(i = 0; i < call->operands_cnt; i++)
|
||||||
if(_encode_operand(plugin, &i, definitions, call->operands)
|
if(_encode_operand(plugin, &i, definitions, call->operands)
|
||||||
!= 0)
|
!= 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user