Message177011
This first patch spots the issue, but doesn't solve it if the bytecode of the function is > 32700 (see PyCode_Optimize comment). However with this patch, we get the LOAD_CONST anytime for None, True and False.
There is two questions :
1- is it safe to strip all the code after RETURN_VALUE as the patch does?
2- to correct this bug, we will need a deep refactoring of PyCode_Optimize (so that it accepts any code length).
The other way, is not to rely on PyCode_Optimize to compile return None/True/False, but do modifictations in the compiler itself. This must be the right way to do this, but it's far beyond my C skills and python core knowledge. |
|
Date |
User |
Action |
Args |
2012-12-05 21:47:47 | bruno.dupuis | set | recipients:
+ bruno.dupuis, ikelly, Horpner, mrabarnett, steven.daprano, alex, cvrebert, python-dev, DragonFireCK |
2012-12-05 21:47:46 | bruno.dupuis | set | messageid: <1354744066.98.0.30584033481.issue16619@psf.upfronthosting.co.za> |
2012-12-05 21:47:46 | bruno.dupuis | link | issue16619 messages |
2012-12-05 21:47:46 | bruno.dupuis | create | |
|