From: Christopher Li <sparse@chrisli.org>
To: John Keeping <john@keeping.me.uk>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH] Fix offsets in anonymous unions
Date: Sun, 1 Jun 2014 00:55:44 -0700 [thread overview]
Message-ID: <CANeU7Qn067TkgFsfHJkd30Q3mEtCvgjwMUt=a3Yfo7Zfcq10fg@mail.gmail.com> (raw)
In-Reply-To: <f6d65cc35d3627885e7a1c89e70a48c3368d4f66.1400764815.git.john@keeping.me.uk>
On Thu, May 22, 2014 at 6:22 AM, John Keeping <john@keeping.me.uk> wrote:
> Commit 38d1124 (Fix error at anoymous unions, 2014-04-03) says:
> @@ -2328,6 +2326,7 @@ static struct expression *check_designators(struct expression *e,
> break;
> }
> e->field = e->ctype = ctype;
> + e->init_offset = offset;
> last = e;
> if (!e->ident_expression) {
OK, this is actually wrong. The member "init_offset" is only
valid for EXPR_POS type. The current e->type is EXPR_IDENTIFIER,
the e->init_offset member actually share the same memory location as
e->expr_ident. In order words, writing to init_offset will corrupt the
e->expr_ident. We did not use e->expr_ident afterwards though.
Chris
prev parent reply other threads:[~2014-06-01 7:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-22 13:22 [PATCH] Fix offsets in anonymous unions John Keeping
2014-05-23 18:40 ` Christopher Li
2014-06-01 7:55 ` Christopher Li [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='CANeU7Qn067TkgFsfHJkd30Q3mEtCvgjwMUt=a3Yfo7Zfcq10fg@mail.gmail.com' \
--to=sparse@chrisli.org \
--cc=john@keeping.me.uk \
--cc=linux-sparse@vger.kernel.org \
/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 NNTP newsgroup(s).