ifaddr.cocci 659 B

12345678910111213141516171819202122232425262728293031323334
  1. /// The address of a variable or field is likely always to be non-zero.
  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:
  8. // Options: --no-includes --include-headers
  9. virtual org
  10. virtual report
  11. virtual context
  12. @r@
  13. expression x;
  14. statement S1,S2;
  15. position p;
  16. @@
  17. *if@p (&x)
  18. S1 else S2
  19. @script:python depends on org@
  20. p << r.p;
  21. @@
  22. cocci.print_main("test of a variable/field address",p)
  23. @script:python depends on report@
  24. p << r.p;
  25. @@
  26. msg = "ERROR: test of a variable/field address"
  27. coccilib.report.print_report(p[0],msg)