]> granicus.if.org Git - python/commit
Fix PyFrame_FastToLocals() and counterpart to deal with cells and
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 21 Mar 2001 16:43:47 +0000 (16:43 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 21 Mar 2001 16:43:47 +0000 (16:43 +0000)
commit220ae7c0bf2054ad01f58e1cf669ac069eb9a574
tree310132f5d0a4b100de585e23d16cf4742e45ae11
parentbec1958d972b551ba72f79b7cd6e75946f3c478d
Fix PyFrame_FastToLocals() and counterpart to deal with cells and
frees.  Note there doesn't seem to be any way to test LocalsToFast(),
because the instructions that trigger it are illegal in nested scopes
with free variables.

Fix allocation strategy for cells that are also formal parameters.
Instead of emitting LOAD_FAST / STORE_DEREF pairs for each parameter,
have the argument handling code in eval_code2() do the right thing.

A side-effect of this change is that cell variables that are also
arguments are listed at the front of co_cellvars in the order they
appear in the argument list.
Objects/frameobject.c
Python/ceval.c
Python/compile.c