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 serhiy.storchaka
Recipients benjamin.peterson, georg.brandl, larry, serhiy.storchaka, skrah, vstinner
Date 2014-01-29.18:14:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391019258.76.0.341506038923.issue20440@psf.upfronthosting.co.za>
In-reply-to
Content
Proposed patches replaced idiomatic code

    Py_DECREF(ptr);
    ptr = new_value;

to "Py_REPLACE(ptr, new_value);" which is expanded to

    {
        PyObject *__tmp__ = ptr;
        ptr = new_value;
        Py_DECREF(__tmp__);
    }

(and same for Py_XDECREF -> Py_XREPLACE).

Victor proposed large patch for issue16447, but this issue was closed after fixing particular bug. Here are updated patches, which Py_REPLACE/Py_XREPLACE macros for cleaner code. They are also generated automatically by the Coccinelle tool (http://coccinelle.lip6.fr/):

spatch --in-place --sp-file py_replace.spatch --dir .

Patch for every version contains about 50 replaces in about 21-24 files.
History
Date User Action Args
2014-01-29 18:14:18serhiy.storchakasetrecipients: + serhiy.storchaka, georg.brandl, vstinner, larry, benjamin.peterson, skrah
2014-01-29 18:14:18serhiy.storchakasetmessageid: <1391019258.76.0.341506038923.issue20440@psf.upfronthosting.co.za>
2014-01-29 18:14:18serhiy.storchakalinkissue20440 messages
2014-01-29 18:14:18serhiy.storchakacreate