Fabio Estevam | dd494ac | 2015-05-09 17:09:29 -0300 | [diff] [blame] | 1 | /// The address of a variable or field is likely always to be non-zero. |
Julia Lawall | 4619c2b | 2012-04-21 20:14:58 +0200 | [diff] [blame] | 2 | /// |
| 3 | // Confidence: High |
| 4 | // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. GPLv2. |
| 5 | // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. GPLv2. |
| 6 | // URL: http://coccinelle.lip6.fr/ |
| 7 | // Comments: |
Nicolas Palix | 93f1446 | 2013-06-20 13:10:56 +0200 | [diff] [blame] | 8 | // Options: --no-includes --include-headers |
Julia Lawall | 4619c2b | 2012-04-21 20:14:58 +0200 | [diff] [blame] | 9 | |
| 10 | virtual org |
| 11 | virtual report |
| 12 | virtual context |
| 13 | |
| 14 | @r@ |
| 15 | expression x; |
| 16 | statement S1,S2; |
| 17 | position p; |
| 18 | @@ |
| 19 | |
| 20 | *if@p (&x) |
| 21 | S1 else S2 |
| 22 | |
| 23 | @script:python depends on org@ |
| 24 | p << r.p; |
| 25 | @@ |
| 26 | |
| 27 | cocci.print_main("test of a variable/field address",p) |
| 28 | |
| 29 | @script:python depends on report@ |
| 30 | p << r.p; |
| 31 | @@ |
| 32 | |
| 33 | msg = "ERROR: test of a variable/field address" |
| 34 | coccilib.report.print_report(p[0],msg) |