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 jeremy.kloth
Recipients brian.curtin, christian.heimes, jeremy.kloth, jkloth, loewis, tim.golden, vstinner
Date 2013-07-08.20:57:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAGvrs3L64dW6BnYRx04F7-7JD69VofnKuzYaaS1o22UMYLCL5A@mail.gmail.com>
In-reply-to <1373311410.1.0.807240571263.issue18407@psf.upfronthosting.co.za>
Content
The change in grammar.c:addlabel() is correct.  The return value is an
index into the ll->ll_label array, thus an int.  The code could be
rewritten to avoid the pointer addition by saving the value of
ll->ll_nlabels before it is incremented and return that instead,

On Mon, Jul 8, 2013 at 1:23 PM, STINNER Victor <report@bugs.python.org> wrote:
>
> STINNER Victor added the comment:
>
> This issue duplicates the isuse #9566, but your patch is interesting. I created other more specific issues like #18295 and #18294.
>
> -    return lb - ll->ll_label;
> +    return Py_SAFE_DOWNCAST(lb - ll->ll_label, Py_intptr_t, int);
>
> I don't think that such change is correct, IMO the right fix is to change the result type to Py_intptr_t.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue18407>
> _______________________________________
History
Date User Action Args
2013-07-08 20:57:26jeremy.klothsetrecipients: + jeremy.kloth, loewis, vstinner, christian.heimes, tim.golden, jkloth, brian.curtin
2013-07-08 20:57:26jeremy.klothlinkissue18407 messages
2013-07-08 20:57:26jeremy.klothcreate