mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 14:49:38 +08:00
sim: cr16: fix build on gcc-12 (NULL comparison)
On gcc-12 build fails as: sim/cr16/interp.c: In function 'lookup_hash': sim/cr16/interp.c:89:25: error: the comparison will always evaluate as 'true' for the address of 'mnimonic' will never be NULL [-Werror=address] 89 | if ((h->ops->mnimonic != NULL) && | ^~ 'mnimonic' is a sharr array within ops. It can never be NULL. While at it renamed 'mnimonic' to 'mnemonic'.
This commit is contained in:
@ -86,8 +86,7 @@ lookup_hash (SIM_DESC sd, SIM_CPU *cpu, uint64 ins, int size)
|
||||
mask = (((1 << (32 - h->mask)) -1) << h->mask);
|
||||
|
||||
/* Adjuest mask for branch with 2 word instructions. */
|
||||
if ((h->ops->mnimonic != NULL) &&
|
||||
((streq(h->ops->mnimonic,"b") && h->size == 2)))
|
||||
if (streq(h->ops->mnemonic,"b") && h->size == 2)
|
||||
mask = 0xff0f0000;
|
||||
|
||||
|
||||
@ -99,7 +98,7 @@ lookup_hash (SIM_DESC sd, SIM_CPU *cpu, uint64 ins, int size)
|
||||
|
||||
mask = (((1 << (32 - h->mask)) -1) << h->mask);
|
||||
/* Adjuest mask for branch with 2 word instructions. */
|
||||
if ((streq(h->ops->mnimonic,"b")) && h->size == 2)
|
||||
if ((streq(h->ops->mnemonic,"b")) && h->size == 2)
|
||||
mask = 0xff0f0000;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user