Prevent an abort in the FRV disassembler if the target bfd name is unknown.
PR 20946 * frv-desc.c (lookup_mach_via_bfd_name): Return NULL if the name could not be matched. (frv_cgen_cpu_open): Allow for lookup_mach_via_bfd_name returning NULL.
This commit is contained in:
parent
c0386d4d54
commit
0ae60c3ef4
2 changed files with 11 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2017-01-05 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR 20946
|
||||||
|
* frv-desc.c (lookup_mach_via_bfd_name): Return NULL if the name
|
||||||
|
could not be matched.
|
||||||
|
(frv_cgen_cpu_open): Allow for lookup_mach_via_bfd_name returning
|
||||||
|
NULL.
|
||||||
|
|
||||||
2017-01-04 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
2017-01-04 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||||
|
|
||||||
* aarch64-tbl.h (RCPC, RCPC_INSN): Define.
|
* aarch64-tbl.h (RCPC, RCPC_INSN): Define.
|
||||||
|
|
|
@ -6173,7 +6173,7 @@ lookup_mach_via_bfd_name (const CGEN_MACH *table, const char *name)
|
||||||
return table;
|
return table;
|
||||||
++table;
|
++table;
|
||||||
}
|
}
|
||||||
abort ();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Subroutine of frv_cgen_cpu_open to build the hardware table. */
|
/* Subroutine of frv_cgen_cpu_open to build the hardware table. */
|
||||||
|
@ -6386,8 +6386,8 @@ frv_cgen_cpu_open (enum cgen_cpu_open_arg arg_type, ...)
|
||||||
const char *name = va_arg (ap, const char *);
|
const char *name = va_arg (ap, const char *);
|
||||||
const CGEN_MACH *mach =
|
const CGEN_MACH *mach =
|
||||||
lookup_mach_via_bfd_name (frv_cgen_mach_table, name);
|
lookup_mach_via_bfd_name (frv_cgen_mach_table, name);
|
||||||
|
if (mach != NULL)
|
||||||
machs |= 1 << mach->num;
|
machs |= 1 << mach->num;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CGEN_CPU_OPEN_ENDIAN :
|
case CGEN_CPU_OPEN_ENDIAN :
|
||||||
|
|
Loading…
Add table
Reference in a new issue