Re: coccinelle: ifaddr: Find address test in more complex conditions

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

 




On Thu, 9 Jun 2022, Markus Elfring wrote:

> >> Markus_Elfring@Sonne:/home/altes_Heim2/elfring/Projekte/Coccinelle/Probe> spatch --parse-cocci show_address_determination_in_checks-20220609.cocci
> >> …
> >> @display@
> >> expression x;
> >> @@
> >>
> >>
> >> (
> >> *&*x *|| *...
> >> |
> >> *&*x *!= *NULL *|| *...
> >> |
> >> *&*x *|| *...
> >> |
> >> *NULL *!= *&*x *|| *...
> >> )
> …
> >> Would another transformation be needed for the omission of trailing binary operators
> >> (according to the shown combinations with SmPL ellipses)?
> > I don't know what you mean.
>
>
> The results from the application of some isomorphism are shown by the mentioned command.
>
>
>
> > How about trying an example?
>
>
> You might interpret the following test result as an expected one according to
> your understanding of implementation details.
>
> Markus_Elfring@Sonne:/home/altes_Heim2/elfring/Projekte/Coccinelle/Probe> spatch show_address_determination_in_checks-20220609.cocci initialisation_test2-20220609.c
> …
> @@ -1,8 +1,6 @@
>  void check(void)
>  {
>  int s = 1;
> -bool t = &s ? 0 : 1;
>  bool u;
> -u = &t ? 1 : 0;
>  }
>
>
>
> I observed that no questionable places were marked in the following source code.
>
>
> void check(void)
> {
> int s = 1;
> bool t = (&s);
> }
>
>
> Will this test case trigger further development considerations?

It seems to be doing what it should.

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