1 // this detects NULL tests that can only be reached when the value is known
5 // Copyright: (C) Gilles Muller, Julia Lawall, EMN, INRIA, DIKU. GPLv2.
6 // URL: http://coccinelle.lip6.fr/rules/notnull.html
15 if (x@p1 == NULL || ...) { ... when forall
17 ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\)
25 // another path to the test that is not through p1?
28 local idexpression r.x;
39 // another path to the test from p1?
46 if (x@p1 == NULL || ...) { ... x@p2 ... when any
49 // another path to the test containing an assignment?
57 if (x@p1 == NULL || ...) { ... when forall
60 \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
69 @fix depends on !s && !t && !u@
76 - if ((x@p2 != NULL) || ...)
79 - if ((x@p2 != NULL) || ...)
89 - if ((x@p2 == NULL) && ...) S1
91 - if ((x@p2 == NULL) && ...) S1 else
94 - BUG_ON(x@p2 == NULL);
97 @script:python depends on !s && !t && !u && !fix@
103 cocci.print_secs("retest",p2)