mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
PR26410, UBSAN: symbols.c:1818
Don't memset(0,0,0). PR 26410 * symbols.c (dollar_label_count, dollar_label_max): Make size_t. (dollar_label_clear): Don't call memset with NULL pointer.
This commit is contained in:
parent
ca159256b4
commit
30b940a097
@ -1,3 +1,9 @@
|
||||
2020-08-25 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 26410
|
||||
* symbols.c (dollar_label_count, dollar_label_max): Make size_t.
|
||||
(dollar_label_clear): Don't call memset with NULL pointer.
|
||||
|
||||
2020-08-25 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* config/tc-arc.c (declare_register_set): Avoid false positive
|
||||
|
@ -1761,8 +1761,8 @@ snapshot_symbol (symbolS **symbolPP, valueT *valueP, segT *segP, fragS **fragPP)
|
||||
static long *dollar_labels;
|
||||
static long *dollar_label_instances;
|
||||
static char *dollar_label_defines;
|
||||
static unsigned long dollar_label_count;
|
||||
static unsigned long dollar_label_max;
|
||||
static size_t dollar_label_count;
|
||||
static size_t dollar_label_max;
|
||||
|
||||
int
|
||||
dollar_label_defined (long label)
|
||||
@ -1798,7 +1798,8 @@ dollar_label_instance (long label)
|
||||
void
|
||||
dollar_label_clear (void)
|
||||
{
|
||||
memset (dollar_label_defines, '\0', (unsigned int) dollar_label_count);
|
||||
if (dollar_label_count)
|
||||
memset (dollar_label_defines, '\0', dollar_label_count);
|
||||
}
|
||||
|
||||
#define DOLLAR_LABEL_BUMP_BY 10
|
||||
|
Loading…
Reference in New Issue
Block a user