On Thu, 4 Jun 2020, Denis Efremov wrote:

> On 6/3/20 10:45 PM, Julia Lawall wrote:
> > subE is a expressionof whatever expression was previously matched to E in
> > the rule ifm.  <= can only be used when the metavariable on the right side
> > is inherited from another rule.  Ths is probably what you want for your
> > problem.
>
> In this case I don't understand the difference between:
>
> "expression ifm.E" and "expression subE <= ifm.E"

subE should match any subexpression of ifm.E.  If you have a concrete
example (code and semantic patch) where it is not doing that, I can look
at it.  I haven't used this feature very much.

julia

>
> For example, in kfree.cocci:
>
> @r exists@
> expression free.E, subE<=free.E, E2;
> expression E1;
> ...
> @@
>
> (
> * kfree@p1(E,...)
> |
> * kzfree@p1(E,...)
> )
> ...
> (
>  iter(...,subE,...) S // no use
> |
>  list_remove_head(E1,subE,...)
> |
>  subE = E2
>
>
> Regards,
>
> Denis
>
>
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to