Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

coccinelle: Extend address test from ifaddr semantic patch to test expressions

The test of an expression's address does not necessarily represent the
whole condition, it may only be a part of it. Also, an expression's
address is likely to be non-zero in every test expression, not only in
if statements.

This change aims at detecting an address test in more complex conditions
and not only in if statements.

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@netatmo.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>

authored by

Jérémy LEFAURE and committed by
Julia Lawall
38857318 20855e4c

+1 -3
+1 -3
scripts/coccinelle/misc/ifaddr.cocci scripts/coccinelle/misc/test_addr.cocci
··· 14 14 15 15 @r@ 16 16 expression x; 17 - statement S1,S2; 18 17 position p; 19 18 @@ 20 19 21 - *if@p (&x) 22 - S1 else S2 20 + *\(&x@p == NULL \| &x@p != NULL\) 23 21 24 22 @script:python depends on org@ 25 23 p << r.p;