[PATCH] Adding new checker idea to clang-analyzer www

Anna Zaks ganna at apple.com
Wed Jul 31 10:54:00 PDT 2013


Todd, out of curiosity, are you interested in working on these checks yourself?

It would be useful to include a link/reference to the python docs or, even better, the specific sections that document string formatting and ref counting APIs.

+Ensure that objects are freed objects are not used and that objects are freed when no longer in use. 
+Also ensure that correct use of Py_INCREF, Py_DECREF, Py_XINCREF, and Py_XDECREF in various circumstances. 
The wording on this one is off. 

This check is only partially related to RefCount, no?
+PyObject* test3() {
+  ...
+  return Py_None; //warn
+}

Thanks,
Anna.

On Jul 30, 2013, at 1:39 PM, Todd Nowacki <nowacki724 at gmail.com> wrote:

> I added a checker idea to the "Possible Future Checkers".
> 
> The checkers would check various aspects of the Python/C API. see http://docs.python.org/3.1/c-api/index.html
> 
> One checker would ensure that the format string given to the functions for parsing arguments and building values (Py_BuildValue, PyArg_ParseTuple, etc.)
> is not malformed and matches the arguments given. 
> 
> The other would check that objects are freed objects are not used and that objects are freed when no longer in use. It would also ensure that correct use of Py_INCREF, Py_DECREF, Py_XINCREF, and Py_XDECREF in various circumstances.
> 
> -Todd Nowacki
> <checkerIdea.patch>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130731/4086a4be/attachment.html>


More information about the cfe-commits mailing list