David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /// The address of a variable or field is likely always to be non-zero. |
| 3 | /// |
| 4 | // Confidence: High |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 5 | // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6. |
| 6 | // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 7 | // URL: http://coccinelle.lip6.fr/ |
| 8 | // Comments: |
| 9 | // Options: --no-includes --include-headers |
| 10 | |
| 11 | virtual org |
| 12 | virtual report |
| 13 | virtual context |
| 14 | |
| 15 | @r@ |
| 16 | expression x; |
| 17 | statement S1,S2; |
| 18 | position p; |
| 19 | @@ |
| 20 | |
| 21 | *if@p (&x) |
| 22 | S1 else S2 |
| 23 | |
| 24 | @script:python depends on org@ |
| 25 | p << r.p; |
| 26 | @@ |
| 27 | |
| 28 | cocci.print_main("test of a variable/field address",p) |
| 29 | |
| 30 | @script:python depends on report@ |
| 31 | p << r.p; |
| 32 | @@ |
| 33 | |
| 34 | msg = "ERROR: test of a variable/field address" |
| 35 | coccilib.report.print_report(p[0],msg) |