diff options
author | David Malcolm <dmalcolm@redhat.com> | 2009-11-13 18:40:22 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2009-11-13 18:40:22 -0500 |
commit | 3ca4127da545d54fb285864892883cea079da642 (patch) | |
tree | 51458d8475c0e6328adf43ace6ed7f9be05f83f0 /pyarg-parsetuple.cocci | |
parent | 5f27e15adc7a7edf7adc20e081b59ab468610627 (diff) | |
download | check-cpython-3ca4127da545d54fb285864892883cea079da642.tar.gz check-cpython-3ca4127da545d54fb285864892883cea079da642.tar.xz check-cpython-3ca4127da545d54fb285864892883cea079da642.zip |
Various fixups
Diffstat (limited to 'pyarg-parsetuple.cocci')
-rw-r--r-- | pyarg-parsetuple.cocci | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pyarg-parsetuple.cocci b/pyarg-parsetuple.cocci index 4beb481..706a489 100644 --- a/pyarg-parsetuple.cocci +++ b/pyarg-parsetuple.cocci @@ -11,7 +11,7 @@ PyArg_ParseTuple(args, fmt@p1, e1) @initialize:python@ import sys sys.path.append('.') -from validate import * +from validate import validate_types @script:python@ args << ParseTuple_1.args; @@ -22,12 +22,17 @@ p1 << ParseTuple_1.p1; """ Analyze format strings, compare to vararg types actually passed + +FIXME: generalize this to varargs """ -# FIXME: generalize this to varargs #print "args: %s" % args #print "fmt: %s" % fmt #print "var1: %s" % t1 #print get_types(fmt.expr) -print p1[0].__dict__ #.line, p1.column -validate_types(fmt.expr, [t1]) + +# For some reason, locations are coming as a 1-tuple containing a Location (from +# coccilibs.elems), rather than the location itself +# Hence we use p1[0], not p1 + +validate_types(p1[0], fmt.expr, [t1]) |