]> granicus.if.org Git - python/commit
Wrote down the invariants of some common objects whose structure is
authorArmin Rigo <arigo@tunes.org>
Thu, 28 Oct 2004 16:32:00 +0000 (16:32 +0000)
committerArmin Rigo <arigo@tunes.org>
Thu, 28 Oct 2004 16:32:00 +0000 (16:32 +0000)
commit89a39461bff04b80bb4857790350e1ab30ff2df9
tree54bc00a9ad30e8e49849874cfbca8543de62fa58
parent063e1e846dc5c3fe593cef5b14cc429369dcd2c2
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.
12 files changed:
Include/cellobject.h
Include/funcobject.h
Include/intobject.h
Include/listobject.h
Include/methodobject.h
Include/rangeobject.h
Include/setobject.h
Include/sliceobject.h
Include/stringobject.h
Include/tupleobject.h
Lib/test/test_funcattrs.py
Objects/funcobject.c