Message315300
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. |
|
Date |
User |
Action |
Args |
2018-04-14 18:32:01 | bup | set | recipients:
+ bup, paul.moore, tim.golden, zach.ware, steve.dower |
2018-04-14 18:32:01 | bup | set | messageid: <1523730721.0.0.682650639539.issue33279@psf.upfronthosting.co.za> |
2018-04-14 18:32:00 | bup | link | issue33279 messages |
2018-04-14 18:32:00 | bup | create | |
|