Fix potential illegal memory access in Xtensa port.

* xtensa-isa.c (xtensa_isa_init): Don't update lookup table
	entries for sysregs with negative indices.
This commit is contained in:
Max Filippov 2017-08-02 10:38:09 +01:00 committed by Nick Clifton
parent 75800d2cd6
commit d84ed528d4
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
* xtensa-isa.c (xtensa_isa_init): Don't update lookup table
entries for sysregs with negative indices.
2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it

View File

@ -292,7 +292,8 @@ xtensa_isa_init (xtensa_isa_status *errno_p, char **error_msg_p)
xtensa_sysreg_internal *sreg = &isa->sysregs[n];
is_user = sreg->is_user;
isa->sysreg_table[is_user][sreg->number] = n;
if (sreg->number >= 0)
isa->sysreg_table[is_user][sreg->number] = n;
}
/* Set up the interface lookup table. */