Replace "if (x) free (x)" with "free (x)", gas
* atof-generic.c: Replace "if (x) free (x)" with "free (x)" throughout. * config/obj-elf.c: Likewise. * config/tc-aarch64.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-m68k.c: Likewise. * config/tc-nios2.c: Likewise. * config/tc-tic30.c: Likewise. * ecoff.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. * symbols.c: Likewise. * testsuite/gas/all/test-gen.c: Likewise.
This commit is contained in:
parent
9db70fc365
commit
9fbb53c7c8
@ -1,3 +1,19 @@
|
||||
2020-05-21 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* atof-generic.c: Replace "if (x) free (x)" with "free (x)"
|
||||
throughout.
|
||||
* config/obj-elf.c: Likewise.
|
||||
* config/tc-aarch64.c: Likewise.
|
||||
* config/tc-arm.c: Likewise.
|
||||
* config/tc-m68k.c: Likewise.
|
||||
* config/tc-nios2.c: Likewise.
|
||||
* config/tc-tic30.c: Likewise.
|
||||
* ecoff.c: Likewise.
|
||||
* read.c: Likewise.
|
||||
* stabs.c: Likewise.
|
||||
* symbols.c: Likewise.
|
||||
* testsuite/gas/all/test-gen.c: Likewise.
|
||||
|
||||
2020-05-20 Nelson Chu <nelson.chu@sifive.com>
|
||||
|
||||
* testsuite/gas/riscv/priv-reg-fail-read-only-01.s: Updated.
|
||||
|
@ -611,9 +611,7 @@ atof_generic (/* return pointer to just AFTER number we read. */
|
||||
/* Assert sign of the number we made is '+'. */
|
||||
address_of_generic_floating_point_number->sign = digits_sign_char;
|
||||
|
||||
if (temporary_binary_low)
|
||||
free (temporary_binary_low);
|
||||
if (power_binary_low)
|
||||
free (power_binary_low);
|
||||
free (digits_binary_low);
|
||||
}
|
||||
|
@ -2021,7 +2021,6 @@ elf_copy_symbol_attributes (symbolS *dest, symbolS *src)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (destelf->size != NULL)
|
||||
free (destelf->size);
|
||||
destelf->size = NULL;
|
||||
}
|
||||
@ -2124,12 +2123,9 @@ obj_elf_size (int ignore ATTRIBUTE_UNUSED)
|
||||
if (exp.X_op == O_constant)
|
||||
{
|
||||
S_SET_SIZE (sym, exp.X_add_number);
|
||||
if (symbol_get_obj (sym)->size)
|
||||
{
|
||||
xfree (symbol_get_obj (sym)->size);
|
||||
symbol_get_obj (sym)->size = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
symbol_get_obj (sym)->size = XNEW (expressionS);
|
||||
|
@ -8269,7 +8269,6 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg)
|
||||
/* Free the allocated the struct aarch64_inst.
|
||||
N.B. currently there are very limited number of fix-up types actually use
|
||||
this field, so the impact on the performance should be minimal . */
|
||||
if (fixP->tc_fix_data.inst != NULL)
|
||||
free (fixP->tc_fix_data.inst);
|
||||
|
||||
return;
|
||||
@ -9557,7 +9556,6 @@ aarch64_elf_copy_symbol_attributes (symbolS *dest, symbolS *src)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (destelf->size != NULL)
|
||||
free (destelf->size);
|
||||
destelf->size = NULL;
|
||||
}
|
||||
|
@ -2899,7 +2899,6 @@ s_unreq (int a ATTRIBUTE_UNUSED)
|
||||
|
||||
hash_delete (arm_reg_hsh, name, FALSE);
|
||||
free ((char *) reg->name);
|
||||
if (reg->neon)
|
||||
free (reg->neon);
|
||||
free (reg);
|
||||
|
||||
@ -2915,7 +2914,6 @@ s_unreq (int a ATTRIBUTE_UNUSED)
|
||||
{
|
||||
hash_delete (arm_reg_hsh, nbuf, FALSE);
|
||||
free ((char *) reg->name);
|
||||
if (reg->neon)
|
||||
free (reg->neon);
|
||||
free (reg);
|
||||
}
|
||||
@ -2927,7 +2925,6 @@ s_unreq (int a ATTRIBUTE_UNUSED)
|
||||
{
|
||||
hash_delete (arm_reg_hsh, nbuf, FALSE);
|
||||
free ((char *) reg->name);
|
||||
if (reg->neon)
|
||||
free (reg->neon);
|
||||
free (reg);
|
||||
}
|
||||
|
@ -6135,7 +6135,6 @@ pop_mri_control (void)
|
||||
|
||||
n = mri_control_stack;
|
||||
mri_control_stack = n->outer;
|
||||
if (n->top != NULL)
|
||||
free (n->top);
|
||||
free (n->next);
|
||||
free (n->bottom);
|
||||
|
@ -3230,11 +3230,8 @@ nios2_insert_arg (char **parsed_args, const char *insert, int num,
|
||||
static void
|
||||
nios2_free_arg (char **parsed_args, int num ATTRIBUTE_UNUSED, int start)
|
||||
{
|
||||
if (parsed_args[start])
|
||||
{
|
||||
free (parsed_args[start]);
|
||||
parsed_args[start] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* This function swaps the pseudo-op for a real op. */
|
||||
|
@ -1997,7 +1997,6 @@ md_assemble (char *line)
|
||||
|
||||
for (i = 0; i < insn.operands; i++)
|
||||
{
|
||||
if (insn.operand_type[i]->immediate.label)
|
||||
free (insn.operand_type[i]->immediate.label);
|
||||
free (insn.operand_type[i]);
|
||||
}
|
||||
|
@ -2526,9 +2526,7 @@ ecoff_directive_def (int ignore ATTRIBUTE_UNUSED)
|
||||
as_warn (_("empty symbol name in .def; ignored"));
|
||||
else
|
||||
{
|
||||
if (coff_sym_name != (char *) NULL)
|
||||
free (coff_sym_name);
|
||||
if (coff_tag != (char *) NULL)
|
||||
free (coff_tag);
|
||||
|
||||
coff_sym_name = xstrdup (name);
|
||||
|
@ -1332,7 +1332,6 @@ read_a_source_file (const char *name)
|
||||
new_length += 100;
|
||||
}
|
||||
|
||||
if (tmp_buf)
|
||||
free (tmp_buf);
|
||||
|
||||
/* We've "scrubbed" input to the preferred format. In the
|
||||
@ -1801,7 +1800,6 @@ s_comm_internal (int param,
|
||||
out:
|
||||
if (flag_mri)
|
||||
mri_comment_end (stop, stopc);
|
||||
if (name != NULL)
|
||||
free (name);
|
||||
return symbolP;
|
||||
}
|
||||
@ -1862,7 +1860,6 @@ s_mri_common (int small ATTRIBUTE_UNUSED)
|
||||
|
||||
sym = symbol_find_or_make (name);
|
||||
c = restore_line_pointer (c);
|
||||
if (alc != NULL)
|
||||
free (alc);
|
||||
|
||||
if (*input_line_pointer != ',')
|
||||
@ -5814,7 +5811,6 @@ s_incbin (int x ATTRIBUTE_UNUSED)
|
||||
done:
|
||||
if (binfile != NULL)
|
||||
fclose (binfile);
|
||||
if (path)
|
||||
free (path);
|
||||
}
|
||||
|
||||
|
@ -564,7 +564,6 @@ generate_asm_file (int type, const char *file)
|
||||
|
||||
colon (sym);
|
||||
|
||||
if (last_file != NULL)
|
||||
free (last_file);
|
||||
last_file = xstrdup (file);
|
||||
|
||||
|
@ -923,13 +923,11 @@ symbol_find_noref (const char *name, int noref)
|
||||
*copy++ = TOUPPER (c);
|
||||
*copy = '\0';
|
||||
|
||||
if (copy2 != NULL)
|
||||
free (copy2);
|
||||
copy = (char *) name;
|
||||
}
|
||||
|
||||
result = symbol_find_exact_noref (name, noref);
|
||||
if (copy != NULL)
|
||||
free (copy);
|
||||
return result;
|
||||
}
|
||||
|
@ -711,10 +711,8 @@ output_insns (func **insn, FILE *as_in, FILE *dis_out)
|
||||
for (; part-- > 0;)
|
||||
{
|
||||
skip:
|
||||
if (data[part].as_in)
|
||||
free (data[part].as_in);
|
||||
if (data[part].dis_out
|
||||
&& data[part].dis_out != data[part].as_in)
|
||||
if (data[part].dis_out != data[part].as_in)
|
||||
free (data[part].dis_out);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user