Sat, 8 Apr 2000 13:05:39 +0200 (CEST)
Add the co_name field comparison to differentiate named code objects,
even when their code is the same. This caused side effects for -O
because of constant folding.
A side note: anonymous code objects (co_name == "?") would still be
subject to constant folding optimization.
Vladimir MARANGOZOV | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252
I confirm that, to the best of my knowledge and belief, this contribution is
free of any claims of third parties under copyright, patent or other rights
or interests ("claims"). To the extent that I have any such claims, I
hereby grant to CNRI a nonexclusive, irrevocable, royalty-free, worldwide
license to reproduce, distribute, perform and/or display publicly, prepare
derivative versions, and otherwise use this contribution as part of the
Python software and its related documentation, or any derivative versions
thereof, at no cost to CNRI or its licensed users, and to authorize others
to do so.
I acknowledge that CNRI may, at its sole discretion, decide whether or not
to incorporate this contribution in the Python software and its related
documentation. I further grant CNRI permission to use my name and other
identifying information provided to CNRI by me for use in connection with
the Python software and its related documentation.
-------------------------------[ cut here ]---------------------------
*** Python/compile.c-orig Sat Apr 8 11:39:23 2000
--- Python/compile.c Sat Apr 8 11:39:28 2000
*** 153,158 ****
--- 153,160 ----
cmp = PyObject_Compare(co->co_names, cp->co_names);
if (cmp) return cmp;
cmp = PyObject_Compare(co->co_varnames, cp->co_varnames);
+ if (cmp) return cmp;
+ cmp = PyObject_Compare(co->co_name, cp->co_name);