This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cezary
Recipients
Date 2004-08-05.17:46:31
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Large functions with size of a bytecode bigger than
65535 bytes may be incorrectly optimized by
"optimize_code" in "Python/compile.c". Optimalization
happens automaticaly during loading from *.pyc and
cannot be disabled. Codes loaded directly from source
(*.py) are not optimalized and not affected by this bug.

One of task of "optimize_code" is to eliminate
"chained" jumps  (when one of jumps points directly to
unconditional jump). Problems occurs when a first jump
opcode points to JUMP_FORWARD, which target is after
64K boundary. This target adress is copied as absolute
address of the first jump modulo 2**16.

This bug can lead to different symptoms during
execution of a code. You can get an "unknown opcode"
error, but  sometimes results can be unpredicable.

This problem appears in Python 2.3 (tested) and
possibly in 2.4 (alfa). 

Attached scripts generates large functions a writes
disassebles before and after optimalization. You will
find, that some adresses after optimalization are bad. 
 
History
Date User Action Args
2007-08-23 15:39:07adminlinkissue1004088 messages
2007-08-23 15:39:07admincreate