[Cocci] Q: question on disjunction of sub-expression patterns

Julia Lawall julia.lawall at lip6.fr
Sun Apr 23 18:03:06 CEST 2017



On Sun, 23 Apr 2017, Oleg Nesterov wrote:

> On 04/22, Julia Lawall wrote:
> >
> > On Sat, 22 Apr 2017, Oleg Nesterov wrote:
> >
> > > It looks as if only one pattern from disjunction can match in the same statement.
> > > IOW, (PAT1 | PAT2) actually means (PAT1* | PAT2*), not (PAT1 | PAT2)*. Say,
> > >
> > The idea with a disjunction is that if the first rule matches, then that
> > one wins.  Actually, ( A | B ) is encoded as A v (not A & B).
>
> OK, thanks a lot Julia!
>
> Does this mean that I have to write 2 separate rules if I want to track the member
> dereferences? One for "->" and another for ".", because I can't use the "operator"
> metadecl in this case.

This would be safer in any case.

julia


More information about the Cocci mailing list