Re: [PATCH v5] coccinelle: Extend address test from ifaddr semantic patch to test expressions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 1 Jul 2022, Markus Elfring wrote:

> > This change aims at detecting an address test in more complex conditions
> > and not only in if statements.
> …
> > v4 -> v5: Change semantic patch to match explicit tests to NULL +
> > improve commit message
> …
> >  scripts/coccinelle/misc/{ifaddr.cocci => test_addr.cocci} | 4 +---
> …
> > @@ -14,12 +14,10 @@ virtual context
> >
> >  @r@
> >  expression x;
> > -statement S1,S2;
> >  position p;
> >  @@
> >
> > -*if@p (&x)
> > - S1 else S2
> > +*\(&x@p == NULL \| &x@p != NULL\)
>
> …
>
>
> Can another SmPL code example help with the clarification of proposed
> implementation details?
>
> @display@
> expression x;
> binary operator bo = { ==, != };
> @@
> * &x bo NULL

Markus, did you actually try this?  Please try things before suggesting
them.  The whole point of the proposed change is to trigger some
isomorphisms.  I really doubt that any isomorphisms will be triggered with
this suggestion.

julia

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux