mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Wrote down the invariants of some common objects whose structure is
exposed in header files. Fixed a few comments in these headers. As we might have expected, writing down invariants systematically exposed a (minor) bug. In this case, function objects have a writeable func_code attribute, which could be set to code objects with the wrong number of free variables. Calling the resulting function segfaulted the interpreter. Added a corresponding test.
This commit is contained in:
parent
063e1e846d
commit
89a39461bf
12 changed files with 98 additions and 25 deletions
|
@ -11,7 +11,7 @@ returns -1 and sets errno to EBADF if the object is not an PyIntObject.
|
|||
None of the functions should be applied to nil objects.
|
||||
|
||||
The type PyIntObject is (unfortunately) exposed here so we can declare
|
||||
_Py_TrueStruct and _Py_ZeroStruct below; don't use this.
|
||||
_Py_TrueStruct and _Py_ZeroStruct in boolobject.h; don't use this.
|
||||
*/
|
||||
|
||||
#ifndef Py_INTOBJECT_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue