https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107646

--- Comment #5 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
How precisely to track behavior of API entrypoints?  We can’t implement
known_functions that precisely model every entrypoint.

Consider:
https://docs.python.org/3/c-api/dict.html#c.PyDict_SetItem
which has:
Insert val into the dictionary p with a key of key. 
key must be hashable; if it isn’t, TypeError will be raised. 
Return 0 on success or -1 on failure. 
This function does not steal a reference to val.

How much of this could be expressed via function attributes, rather than
known_function subclasses?

List of 20 most commonly used CPython API entrypoints from my 2013 survey:
https://fedorapeople.org/~dmalcolm/presentations/PyCon-US-2013/PyCon-US-2013-dmalcolm-StaticAnalysis.html#(25)

Reply via email to