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 bup
Recipients bup, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-04-14.18:32:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523730721.0.0.682650639539.issue33279@psf.upfronthosting.co.za>
In-reply-to
Content
New to both C and the CPython api so I'm not sure what compiler details matter but this is with VS14 and default compile parameters on windows 10 with 32bit Python.

The following function:

static PyObject *spam(PyObject *module) {
    digit w = 9;
    int x = 9;
    long y = 9;
    int32_t z = 9;
    return Py_BuildValue("(HIK)(lll)(LLL)", w,w,w,x,y,z,x,y,z);  
}

returns:

>>> spam()
((9, 9, 38654705673), (9, 9, 9), (38654705673, 438244858264171835, 6133859984))

Above was the most I could fit in a single Py_BuildValue call without causing a crash (it instantly crashes if "O" or "N" fields are present). I believe this happens because the ints are being upcasted as pointers, which is undefined behavior.
History
Date User Action Args
2018-04-14 18:32:01bupsetrecipients: + bup, paul.moore, tim.golden, zach.ware, steve.dower
2018-04-14 18:32:01bupsetmessageid: <1523730721.0.0.682650639539.issue33279@psf.upfronthosting.co.za>
2018-04-14 18:32:00buplinkissue33279 messages
2018-04-14 18:32:00bupcreate