All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@inria.fr>, cocci@inria.fr
Subject: Re: [cocci] Searching for selected variable assignments (with SmPL)?
Date: Sat, 6 Sep 2025 15:20:33 +0200	[thread overview]
Message-ID: <5bea704c-e59f-4438-8729-e48afbcd6832@web.de> (raw)
In-Reply-To: <4c46da9-1fa9-9b4f-f0c7-6c7fd094e163@inria.fr>

>> How can be achieved that the search for variable assignments will be repeated
>> after such a statement was found?
> There is no after.  Such variable assignments are matched throughout the
> entire function.

The awareness grew for another implementation detail somehow.
Thus I hope that the following SmPL script variant can help also to achieve
a better common understanding.

@find1@
expression e;
position place;
type t;
t * pointer;
@@
 pointer = e(...);@place

@display1@
expression x;
position find1.place;
statement s;
type find1.t;
t * find1.pointer;
@@
*x;@place
 if (!pointer)
    s
 ... when != pointer

@find2@
expression e, x;
position find1.place, place2;
type t;
t * pointer;
@@
 x;@place
 ... when != pointer
 pointer = e(...);@place2

@display2@
expression x;
position find2.place2;
statement s;
type find2.t;
t * find2.pointer;
@@
*x;@place2
 if (!pointer)
    s
 ... when != pointer


Regards,
Markus

  parent reply	other threads:[~2025-09-06 13:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 12:36 [cocci] Searching for missing cleanup function calls (with SmPL)? Markus Elfring
2025-09-04 12:43 ` Julia Lawall
2025-09-04 12:58   ` Markus Elfring
2025-09-12  9:29   ` Markus Elfring
2025-09-12 11:07     ` Julia Lawall
2025-09-12 12:30       ` Markus Elfring
2025-09-12 13:43     ` Markus Elfring
2025-09-12 15:43   ` Markus Elfring
2025-09-06  8:00 ` [cocci] Searching for selected variable assignments " Markus Elfring
2025-09-06  8:07   ` Julia Lawall
2025-09-06  8:10     ` Markus Elfring
2025-09-06  8:22       ` Julia Lawall
2025-09-06  9:11         ` Markus Elfring
2025-09-06  9:14           ` Julia Lawall
2025-09-06  9:28             ` Markus Elfring
2025-09-06 10:25               ` Markus Elfring
2025-09-06 11:12                 ` Julia Lawall
2025-09-06 12:07                   ` Markus Elfring
2025-09-06 12:13                     ` Julia Lawall
2025-09-06 12:30                       ` Markus Elfring
2025-09-06 12:36                         ` Julia Lawall
2025-09-06 12:47                           ` Markus Elfring
2025-09-06 12:51                             ` Julia Lawall
2025-09-06 13:20     ` Markus Elfring [this message]
2025-09-08  6:15       ` Markus Elfring

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=5bea704c-e59f-4438-8729-e48afbcd6832@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@inria.fr \
    --cc=julia.lawall@inria.fr \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.