mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 02:50:08 +08:00
PR26441, ASAN: get_b_cc tc-cr16.c:1521
PR 26441 * config/tc-cr16.c (get_b_cc): Return NULL early if op isn't two or three chars, and don't bother copying.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2020-08-25 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
PR 26441
|
||||||
|
* config/tc-cr16.c (get_b_cc): Return NULL early if op isn't
|
||||||
|
two or three chars, and don't bother copying.
|
||||||
|
|
||||||
2020-08-25 Alan Modra <amodra@gmail.com>
|
2020-08-25 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
PR 26426
|
PR 26426
|
||||||
|
@ -1513,15 +1513,12 @@ static char *
|
|||||||
get_b_cc (char * op)
|
get_b_cc (char * op)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
char op1[5];
|
|
||||||
|
|
||||||
for (i = 1; i < strlen (op); i++)
|
if (op[1] == 0 || (op[2] != 0 && op[3] != 0))
|
||||||
op1[i-1] = op[i];
|
return NULL;
|
||||||
|
|
||||||
op1[i-1] = '\0';
|
|
||||||
|
|
||||||
for (i = 0; i < cr16_num_cc ; i++)
|
for (i = 0; i < cr16_num_cc ; i++)
|
||||||
if (streq (op1, cr16_b_cond_tab[i]))
|
if (streq (op + 1, cr16_b_cond_tab[i]))
|
||||||
return (char *) cr16_b_cond_tab[i];
|
return (char *) cr16_b_cond_tab[i];
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user