All of lore.kernel.org
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Checking data structure modification with SmPL
Date: Sat, 22 Aug 2015 17:58:05 +0200	[thread overview]
Message-ID: <55D89C0D.80307@users.sourceforge.net> (raw)
In-Reply-To: <alpine.DEB.2.10.1508220716010.2531@hadrien>

>> Now I would like to support more possibilities for the determination
>> of affected members from the shown variable.
>>
>>
>> @show_modification_before_memory_release@
>> expression element, value;
>> identifier var;
>> @@
>>  <+...
>> *var->element = value;
> 
> Element is not an expression.  An expression is something that has a value.
> A field name has no value.  It just enables selecting a field.

Thanks for your clarification.


> Probably what you want is <+...var->element...+>, ie something that has
> var->element as a subexpression.

* Do I need to restrict the amount of source code which can appear between
  data structure access and the shown value assignment that should be checked
  by such a SmPL construct?

* Do I need to fiddle with another SmPL disjunction to express
  the possibility that "var" could be more than a simple identifier?

* How should the support for longer arrow chains be specified?


> To avoid parsing ambiguities, you will need to put () around this,
> but it will not affect the results.

Thanks for this hint.


>>  ...+>
>>  free(var);


Regards,
Markus

  reply	other threads:[~2015-08-22 15:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 11:34 [Cocci] Checking data structure modification with SmPL SF Markus Elfring
2015-08-22 14:17 ` Julia Lawall
2015-08-22 15:58   ` SF Markus Elfring [this message]
2015-08-22 16:05     ` Julia Lawall
2015-08-22 16:50       ` SF Markus Elfring
2015-08-22 19:07         ` Julia Lawall
2015-08-22 20:01           ` SF Markus Elfring
     [not found]             ` <alpine.DEB.2.10.1508221303590.2446@hadrien>
2015-08-22 20:50               ` SF 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=55D89C0D.80307@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=cocci@systeme.lip6.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.