Author bruno.dupuis
Recipients DragonFireCK, Horpner, alex, bruno.dupuis, cvrebert, ikelly, mrabarnett, python-dev, steven.daprano
Date 2012-12-05.21:47:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1354744066.98.0.30584033481.issue16619@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-12-05 21:47:47bruno.dupuissetrecipients: + bruno.dupuis, ikelly, Horpner, mrabarnett, steven.daprano, alex, cvrebert, python-dev, DragonFireCK
2012-12-05 21:47:46bruno.dupuissetmessageid: <1354744066.98.0.30584033481.issue16619@psf.upfronthosting.co.za>
2012-12-05 21:47:46bruno.dupuislinkissue16619 messages
2012-12-05 21:47:46bruno.dupuiscreate