From: Julia Lawall <julia.lawall@inria.fr>
To: Kees Cook <keescook@chromium.org>
Cc: Julia Lawall <julia.lawall@inria.fr>, cocci@inria.fr
Subject: Re: [cocci] metavariables in added attribute arguments
Date: Mon, 1 May 2023 23:27:43 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.22.394.2305012327350.2911@hadrien> (raw)
In-Reply-To: <645026ea.620a0220.f1a4f.8a79@mx.google.com>
On Mon, 1 May 2023, Kees Cook wrote:
> On Sat, Apr 29, 2023 at 03:17:40PM +0200, Julia Lawall wrote:
> > > [...]
> > > @annotate@
> > > type COUNTER_TYPE, ARRAY_TYPE;
> > > identifier allocated.STRUCT;
> > > identifier allocated.ARRAY;
> > > identifier allocated.COUNTER;
> > > attribute name __counted_by;
> > > @@
> > >
> > > struct STRUCT {
> > > ...
> > > COUNTER_TYPE COUNTER;
> > > ...
> > > ARRAY_TYPE ARRAY[]
> > > + __counted_by(COUNTER)
> > > ;
> > > };
> > >
> > > This fails like so:
> > >
> > > $ cocci element_count.cocci net/packet/af_packet.c
> > > plus: parse error:
> > > File "element_count.cocci", line 33, column 15, charpos = 593
> > > around = 'COUNTER',
> > > whole content = + __counted_by(COUNTER)
> > >
> > > But I can produce (nonsense) output if I change the replacement to:
> > >
> > > ARRAY_TYPE ARRAY[
> > > + COUNTER
> > > ]
> > > + __counted_by
> > > ;
> > >
> > > Explicitly using "attribute name __counted_by;" didn't seem to help.
> > > What am I missing?
> >
> > The problem is fixed. Actually, attributes in this position were just not
> > supported at all. Thanks very much for the report.
>
> Hurray! Thank you; the latest git works as I'd expect now. :) Now to get
> my patch for the Linux kernel split up...
>
> 153 files changed, 157 insertions(+), 157 deletions(-)
:)
julia
prev parent reply other threads:[~2023-05-01 21:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 20:50 [cocci] metavariables in added attribute arguments Kees Cook
2023-04-28 8:18 ` Julia Lawall
2023-04-29 13:17 ` Julia Lawall
2023-05-01 20:54 ` Kees Cook
2023-05-01 21:27 ` Julia Lawall [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=alpine.DEB.2.22.394.2305012327350.2911@hadrien \
--to=julia.lawall@inria.fr \
--cc=cocci@inria.fr \
--cc=keescook@chromium.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 read-only IMAP folder(s) and NNTP newsgroup(s).