Message223480
The relevant piece of code in the struct module looks like this:
static PyObject *
nu_bool(const char *p, const formatdef *f)
{
BOOL_TYPE x;
memcpy((char *)&x, p, sizeof x);
return PyBool_FromLong(x != 0);
}
Is it possible that BOOL_TYPE is a bitfield of length 1, and that clang is somehow making use of that fact?
One thing I don't understand is that this shouldn't affect *standard* packing and unpacking (as opposed to native), but I still see the problem for a format of "<????". However, it's fine for ">????". Some debugging shows that we're calling 'nu_bool' even for "<????", which is a bit odd. |
|
Date |
User |
Action |
Args |
2014-07-19 21:22:46 | mark.dickinson | set | recipients:
+ mark.dickinson, ronaldoussoren, ned.deily, wayedt |
2014-07-19 21:22:45 | mark.dickinson | set | messageid: <1405804965.98.0.492983260943.issue22012@psf.upfronthosting.co.za> |
2014-07-19 21:22:45 | mark.dickinson | link | issue22012 messages |
2014-07-19 21:22:45 | mark.dickinson | create | |
|