[issue16619] LOAD_GLOBAL used to load `None` under certain circumstances

Bruno Dupuis report at bugs.python.org
Thu Dec 6 01:37:02 CET 2012


Bruno Dupuis added the comment:

We definitely need to put the code that loads constants with LOAD_CONST out of the optimization code. It's not optim, it's a language feature: None *is* a 'singleton' constant.

I'm trying to figure out how to change compile.c to achieve this, as it's my first dive into the compiler code, it's not that easy.

Another approch is to strip unreachable nodes in AST, but

a) it's quite complex, as Terry said

b) it solves only this particular bug, not the general assertion "None, True and False are reserved words bound to constants. It can not ever be loaded with LOAD_NAME or LOAD_GLOBAL"

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16619>
_______________________________________


More information about the Python-bugs-list mailing list