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 thesamprice
Recipients thesamprice
Date 2020-03-05.15:57:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583423861.69.0.103989515875.issue39858@roundup.psfhosted.org>
In-reply-to
Content
Does not happen on windows.

Error is in cfield.c

```
#ifndef MS_WIN32
    } else if (bitsize /* this is a bitfield request */
        && *pfield_size /* we have a bitfield open */
        && dict->size * 8 >= *pfield_size
        && (*pbitofs + bitsize) <= dict->size * 8) {
        /* expand bit field */
        fieldtype = EXPAND_BITFIELD;
#endif
```

Specifically dict->size * 8 >= *pfield_size
if *bitofs == *pfield_size then the current field is filled, and expanding the bitfield should not be done.

Consider adding this *pfield_size != *bitofs
#ifndef MS_WIN32
    } else if (bitsize /* this is a bitfield request */
        && *pfield_size /* we have a bitfield open */
        && *pfield_size != *pbitofs /* Current field has been filled, start new one */
        && dict->size * 8 >= *pfield_size
        && (*pbitofs + bitsize) <= dict->size * 8) {
        /* expand bit field */
        fieldtype = EXPAND_BITFIELD;
#endif
History
Date User Action Args
2020-03-05 15:57:41thesampricesetrecipients: + thesamprice
2020-03-05 15:57:41thesampricesetmessageid: <1583423861.69.0.103989515875.issue39858@roundup.psfhosted.org>
2020-03-05 15:57:41thesampricelinkissue39858 messages
2020-03-05 15:57:41thesampricecreate