public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: Jiawei <jiawei@iscas.ac.cn>
Cc: binutils@sourceware.org, nelson@rivosinc.com,
	kito.cheng@sifive.com,  palmer@dabbelt.com, jbeulich@suse.com,
	research_trasio@irq.a4lg.com,  christoph.muellner@vrull.eu,
	jeremy.bennett@embecosm.com,  nandni.jamnadas@embecosm.com,
	mary.bennett@embecosm.com,  charlie.keaney@embecosm.com,
	simon.cook@embecosm.com,  sinan.lin@linux.alibaba.com,
	gaofei@eswincomputing.com,  fujin.zhao@foxmail.com,
	wuwei2016@iscas.ac.cn, shihua@iscas.ac.cn,
	 shiyulong@iscas.ac.cn, chenyixuan@iscas.ac.cn
Subject: Re: [PATCH v6 1/2] RISC-V: Support Zcmp push/pop instructions.
Date: Thu, 1 Feb 2024 20:52:23 +0800	[thread overview]
Message-ID: <CA+yXCZCcmJaGGxSP1sg86M72U3aEvSbFTYhPLbk_j_f=tupu3g@mail.gmail.com> (raw)
In-Reply-To: <20240131141122.350700-1-jiawei@iscas.ac.cn>

> +static bool
> +reglist_lookup (char **s, unsigned *reg_list)
> +{
> +  unsigned regno = 0;
> +  unsigned regnum = 0;
> +  char *reglist = strdup (*s);

char *token;

> +  char *regname[3];
> +
> +  if (reglist == NULL)
> +    goto next;
> +
> +  /* Use reglist to judge the reg name use.  */
> +  reglist = strtok (reglist, "}");

token = strtok (reglist, "}");

You need to keep the original pointer which points to the start of the
space you got, otherwise it will cause problems when you free that.


> +  for(reglist = strtok (reglist, ",");reglist;reglist = strtok(NULL, ",")){

for(token = strtok (token, ","); token ;token = strtok (NULL, ",")) {

> +    regname[regnum] = reglist;

regname[regnum] = token;

      parent reply	other threads:[~2024-02-01 12:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 14:11 Jiawei
2024-01-31 14:11 ` [PATCH v6 2/2] RISC-V: Support Zcmp cm.mv instructions Jiawei
2024-02-01 12:58   ` Kito Cheng
2024-02-01 12:52 ` Kito Cheng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+yXCZCcmJaGGxSP1sg86M72U3aEvSbFTYhPLbk_j_f=tupu3g@mail.gmail.com' \
    --to=kito.cheng@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=charlie.keaney@embecosm.com \
    --cc=chenyixuan@iscas.ac.cn \
    --cc=christoph.muellner@vrull.eu \
    --cc=fujin.zhao@foxmail.com \
    --cc=gaofei@eswincomputing.com \
    --cc=jbeulich@suse.com \
    --cc=jeremy.bennett@embecosm.com \
    --cc=jiawei@iscas.ac.cn \
    --cc=kito.cheng@sifive.com \
    --cc=mary.bennett@embecosm.com \
    --cc=nandni.jamnadas@embecosm.com \
    --cc=nelson@rivosinc.com \
    --cc=palmer@dabbelt.com \
    --cc=research_trasio@irq.a4lg.com \
    --cc=shihua@iscas.ac.cn \
    --cc=shiyulong@iscas.ac.cn \
    --cc=simon.cook@embecosm.com \
    --cc=sinan.lin@linux.alibaba.com \
    --cc=wuwei2016@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).