Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /// The address of a variable or field is likely always to be non-zero.
0003 ///
0004 // Confidence: High
0005 // Copyright: (C) 2012 Julia Lawall, INRIA/LIP6.
0006 // Copyright: (C) 2012 Gilles Muller, INRIA/LiP6.
0007 // URL: https://coccinelle.gitlabpages.inria.fr/website
0008 // Comments:
0009 // Options: --no-includes --include-headers
0010 
0011 virtual org
0012 virtual report
0013 virtual context
0014 
0015 @r@
0016 expression x;
0017 position p;
0018 @@
0019 
0020 *\(&x@p == NULL \| &x@p != NULL\)
0021 
0022 @script:python depends on org@
0023 p << r.p;
0024 @@
0025 
0026 cocci.print_main("test of a variable/field address",p)
0027 
0028 @script:python depends on report@
0029 p << r.p;
0030 @@
0031 
0032 msg = "ERROR: test of a variable/field address"
0033 coccilib.report.print_report(p[0],msg)