On Thu, 7 Sep 2017, SF Markus Elfring wrote:

> >> Now I wonder why the software “Coccinelle 1.0.6-00242-g3f038a5d” finds
> >> this place relevant when the function call sequence does not fit to the 
> >> order
> >> I tried to express for a known use case.
> >> I would appreciate further advice.
> >
> > Because there is a loop,
>
> This information is appropriate.
>
> But I have got difficulties to interpret it in an useful way.


Coccinelle follows control-flow paths.  Thers is a control-flow path from
the bottom of a loop back up to the top.

>
>
> > and you did nothing to prevent an update to q because the free and the 
> > dereference.
>
> I omitted an additional constraint for a simple test.
>
>
> > @usage@
> > identifier action, member, release=~"^.+free$";
> > expression context,e;
> > @@
> > *release(context);
> >  ... when != context = e
> >      when any  // to get all results
> > *action(..., (context)->member, ...)
>
> Should the SmPL construct “<+.. ...+>” work also similar to your suggestion?

<+... ...+> would also not allow context = e after the last match of the
pattern inside the nest.  A when on a <+... ...+> applies to the entire
matched region.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to