Message333877
The bug occurs when GCC emits a single instruction (stxsspx) for cast + memcpy.
I understand that the struct module is not affected because there is a condition branch (if) between the cast ("float x = ...") and the memcpy().
static int
np_float(char *p, PyObject *v, const formatdef *f)
{
float x = (float)PyFloat_AsDouble(v);
if (x == -1 && PyErr_Occurred()) {
PyErr_SetString(StructError,
"required argument is not a float");
return -1;
}
memcpy(p, (char *)&x, sizeof x);
return 0;
} |
|
Date |
User |
Action |
Args |
2019-01-17 14:44:16 | vstinner | set | recipients:
+ vstinner, mark.dickinson, skrah, fweimer, David.Edelsohn, cstratak |
2019-01-17 14:44:14 | vstinner | set | messageid: <1547736254.52.0.711543941858.issue35752@roundup.psfhosted.org> |
2019-01-17 14:44:14 | vstinner | link | issue35752 messages |
2019-01-17 14:44:14 | vstinner | create | |
|