This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] use xstrdup, xmemdup0 and concat more


On Thu, May 12, 2016 at 10:33:24PM -0400, tbsaunde+binutils@tbsaunde.org wrote:
> This is mostly the same patch I sent a couple weeks ago, but I updated it to
> use xmemdup0 in several places instead of using xstrndup.

Thanks!  OK to commit after fixing a couple of formatting errors.

> diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
[snip]
> @@ -6414,6 +6411,7 @@ hppa_elf_mark_end_of_function (void)
>    /* ELF does not have EXIT relocations.  All we do is create a
>       temporary symbol marking the end of the function.  */
>    char *name;
> +      symbolS *symbolP;
>  
>    if (last_call_info == NULL || last_call_info->start_symbol == NULL)
>      {

Here.

> diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c
> index 725691c..c3e1c8f 100644
> --- a/gas/config/tc-tic30.c
> +++ b/gas/config/tc-tic30.c
> @@ -380,11 +380,8 @@ tic30_find_parallel_insn (char *current_line, char *next_line)
>  	}
>        }
>    }
> -  parallel_insn = malloc (strlen (first_opcode) + strlen (first_operands)
> -			  + strlen (second_opcode) + strlen (second_operands) + 8);
> -  sprintf (parallel_insn, "q_%s_%s %s | %s",
> -	   first_opcode, second_opcode,
> -	   first_operands, second_operands);
> +parallel_insn = concat ("q_", first_opcode, "_", second_opcode, " ",
> +		       	first_operands, " | ", second_operands, (char *) NULL);
>    debug ("parallel insn = %s\n", parallel_insn);
>    return parallel_insn;
>  }

and here.

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]