1 // This detects NULL tests that can only be reached when the value is known
5 // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2.
6 // URL: http://www.emn.fr/x-info/coccinelle/rules/notnull.html
17 if (x@p1 == NULL || ...) { ... when forall
19 ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\)
27 // another path to the test that is not through p1?
30 local idexpression r.x;
41 // another path to the test from p1?
48 if (x@p1 == NULL || ...) { ... x@p2 ... when any
51 // another path to the test containing an assignment?
59 if (x@p1 == NULL || ...) { ... when forall
62 \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
71 @script:python depends on !s && !t && !u && org @
76 cocci.print_main("",p2)
77 cocci.print_secs("",p1)
79 @depends on !s && !t && !u && diff@