gcc-python-plugin
                                
                                 gcc-python-plugin copied to clipboard
                                
                                    gcc-python-plugin copied to clipboard
                            
                            
                            
                        GCC plugin that embeds CPython inside the compiler
Lots of false positives due to lack of interprocedual knowledge. See e.g.: http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-04-04/rrdtool-1.4.7-5.fc17/rrdtool-1.4.7/bindings/python/build/temp.linux-x86_64-2.7/rrdtoolmodule.c.PyRRD_graph-refcount-errors.html#report-2 where presumably create_args() < 0 implies that an exception has already been set. Similarly: identify functions that...
See e.g.: http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-04-03/python-kaa-base-0.6.0-6.fc17/kaa-base-0.6.0/build/temp.linux-x86_64-2.7/src/extensions/shmmodule.c.PyShm_memory-refcount-errors.html#report-1 PyMapping_HasKey should imply that PyDict_GetItem should succeed, but the checker erroneoulsly considers that the latter could.
Checking sanlock-python the following error is raised: {{{ /home/simon/gcc-python-plugin/gcc-with-cpychecker -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions...
currently, when PyErr_Occurred() is called, the transition's description merely says "PyErr_Occurred()" It ought to describe NULL vs non-NULL exceptions, to make it easier to read traces
See e.g.: http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-03-05/pygoocanvas-0.14.1-6.fc17/pygoocanvas-0.14.1/.libs/goocanvas.c._wrap_goo_canvas_item_model_get_child_properties-refcount-errors.html#report-0 The checker considered that the possibility of PyTuple_SetItem() failing due to index out of range (and thus not stealing the reference, leading to a leak), but it's...
Attached there is a patch sketching PyString_AsStringAndSize. the function takes two output parameters and returns 0 in case of success, -1 on failure. I've only implemented the return value; as...
http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-02-18/postgresql-9.1.2-2.fc17/postgresql-9.1.2/src/pl/plpython/plpython.c.PLy_output-refcount-errors.html#report-1
I got this error when trying to use gccutils.pformat when compiling C code: {{{ File "/home/tromey/Space/Trunk/gcc-python-plugin/cvtlisp.py", line 204, in map_tree print gccutils.pformat(tree) File "/home/tromey/Space/Trunk/gcc-python-plugin/gccutils.py", line 123, in pformat return pp.pformat(obj)...
I noticed recently that gcc.Gimple has a 'loc' attribute, but gcc.Declaration has a 'location' attribute. I think it would be better to use a single name everywhere.
Before there is a CFG, the body of a function is in the function decl's DECL_INITIAL, as a block. This field should be exposed to Python. This patch adds the...