From: Manish Goregaokar <manish@mozilla.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org, Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH] Use strtok_r instead of strsep in rust_get_disr_info
Date: Wed, 29 Jun 2016 10:39:00 -0000 [thread overview]
Message-ID: <CAFOnWkkFv0p8sZk71xDptmVH74cQUCyfL-AKP5iBY0D02XB8PA@mail.gmail.com> (raw)
In-Reply-To: <7ab96fcb-ffcd-c1ec-187d-f8ec05e43923@redhat.com>
strsep moves the pointer to the end of the string. We want to ensure
the early break happens, since we need token to contain the name of
the variant at this stage.
strtok doesn't do this. However, strtok does make it NULL, which we
don't want either. I added a check for it in my most recent email,
tests still pass.
Thanks,
-Manish
On Wed, Jun 29, 2016 at 4:06 PM, Pedro Alves <palves@redhat.com> wrote:
> On 06/29/2016 11:31 AM, Manish Goregaokar wrote:
>> @@ -161,8 +163,6 @@ rust_get_disr_info (struct type *type, const
>> gdb_byte *valaddr,
>> member_type = TYPE_FIELD_TYPE (member_type, fieldno);
>> }
>>
>> - if (token >= name + strlen (TYPE_FIELD_NAME (type, 0)))
>> - error (_("Invalid form for %s"), RUST_ENUM_PREFIX);
>> value = unpack_long (member_type, valaddr + embedded_offset);
>>
>> if (value == 0)
>
> Why was this bit removed?
>
> Thanks,
> Pedro Alves
>
next prev parent reply other threads:[~2016-06-29 10:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-29 10:14 Manish Goregaokar
2016-06-29 10:26 ` Pedro Alves
2016-06-29 10:32 ` Manish Goregaokar
2016-06-29 10:35 ` Manish Goregaokar
2016-06-29 10:36 ` Pedro Alves
2016-06-29 10:39 ` Manish Goregaokar [this message]
2016-06-29 10:44 ` Pedro Alves
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=CAFOnWkkFv0p8sZk71xDptmVH74cQUCyfL-AKP5iBY0D02XB8PA@mail.gmail.com \
--to=manish@mozilla.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=tom@tromey.com \
/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