Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 92d2bfb5a363004a8a399eefe5c79f14 > files > 125

coccinelle-examples-1.0.0-0.rc4.2.fc16.i686.rpm

@initialize:python@
import re
m = re.compile('_new$')

@r_init@
expression E;
identifier id;
position p;
@@

E = id@p();

@script:python@
id << r_init.id;
@@

print "COCCI: Analyzing %s" % id
if m.search(id.ident) != None:
	print "COCCI: %s matchs '_new$'" % id
else:
	print "COCCI: %s discarded" % id
	cocci.include_match(False)


@r_do@
expression E;
identifier id;
position r_init.p;
@@

E = id@p();
+ if (E == NULL)
+   goto err;