Line 728... |
Line 728... |
|
|
automata = (unsigned long *) malloc (MAX_AUTOMATA_SIZE * sizeof (unsigned long));
|
automata = (unsigned long *) malloc (MAX_AUTOMATA_SIZE * sizeof (unsigned long));
|
ti = (struct temp_insn_struct *) malloc (sizeof (struct temp_insn_struct) * num_opcodes);
|
ti = (struct temp_insn_struct *) malloc (sizeof (struct temp_insn_struct) * num_opcodes);
|
|
|
nuncovered = num_opcodes;
|
nuncovered = num_opcodes;
|
|
|
|
#ifdef HAS_EXECUTION
|
printf("Building automata... ");
|
printf("Building automata... ");
|
|
#endif
|
|
|
/* Build temporary information about instructions. */
|
/* Build temporary information about instructions. */
|
for (i = 0; i < num_opcodes; i++)
|
for (i = 0; i < num_opcodes; i++)
|
{
|
{
|
unsigned long ones, zeros;
|
unsigned long ones, zeros;
|
char *encoding = or32_opcodes[i].encoding;
|
char *encoding = or32_opcodes[i].encoding;
|
Line 750... |
Line 754... |
if (end - automata > MAX_AUTOMATA_SIZE)
|
if (end - automata > MAX_AUTOMATA_SIZE)
|
{
|
{
|
fprintf (stderr, "Automata too large. Increase MAX_AUTOMATA_SIZE.");
|
fprintf (stderr, "Automata too large. Increase MAX_AUTOMATA_SIZE.");
|
exit (1);
|
exit (1);
|
}
|
}
|
|
#ifdef HAS_EXECUTION
|
printf("done, num uncovered: %i/%i.\n", nuncovered, num_opcodes);
|
printf("done, num uncovered: %i/%i.\n", nuncovered, num_opcodes);
|
|
#endif
|
|
|
|
#ifdef HAS_EXECUTION
|
printf("Parsing operands data... ");
|
printf("Parsing operands data... ");
|
|
#endif
|
op_data = (struct insn_op_struct *) malloc (MAX_OP_TABLE_SIZE * sizeof (struct insn_op_struct));
|
op_data = (struct insn_op_struct *) malloc (MAX_OP_TABLE_SIZE * sizeof (struct insn_op_struct));
|
op_start = (struct insn_op_struct **) malloc (num_opcodes * sizeof (struct insn_op_struct *));
|
op_start = (struct insn_op_struct **) malloc (num_opcodes * sizeof (struct insn_op_struct *));
|
cur = op_data;
|
cur = op_data;
|
for (i = 0; i < num_opcodes; i++)
|
for (i = 0; i < num_opcodes; i++)
|
{
|
{
|
Line 766... |
Line 774... |
{
|
{
|
fprintf (stderr, "Operands table too small, increase MAX_OP_TABLE_SIZE.\n");
|
fprintf (stderr, "Operands table too small, increase MAX_OP_TABLE_SIZE.\n");
|
exit (1);
|
exit (1);
|
}
|
}
|
}
|
}
|
|
#ifdef HAS_EXECUTION
|
printf("done.\n");
|
printf("done.\n");
|
|
#endif
|
}
|
}
|
|
|
void destruct_automata ()
|
void destruct_automata ()
|
{
|
{
|
free (ti);
|
free (ti);
|