]> granicus.if.org Git - python/commit
Fix computation of stack depth for classdef and closures.
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 17 Oct 2001 13:22:22 +0000 (13:22 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 17 Oct 2001 13:22:22 +0000 (13:22 +0000)
commit93a569d6342215fbcf3d1df78184d669ac42527d
tree909d09cb52f2dd46cdc6461f3c96301f1fe29f0b
parent4bf1fb63e4efaaf8d29b06701136a7f4c8291675
Fix computation of stack depth for classdef and closures.
Also minor tweaks to internal routines.
Use PyCF_MASK instead of explicit list of flags.

For the MAKE_CLOSURE opcode, the number of items popped off the stack
depends on both the oparg and the number of free variables for the
code object.  Fix the code so it accounts for the free variables.

In com_classdef(), record an extra pop to account for the STORE call
after the BUILD_CLASS.

Get rid of some commented out debugging code in com_push() and
com_pop().

Factor string resize logic into helper routine com_check_size().

In com_addbyte(), remove redudant if statement after assert.  (They
test the same condition.)

In several routines, use string macros instead of string functions.
Python/compile.c