Message363440
I ran into this bug on mac and submitted a duplicate issue of 39858
If you add the check *pfield_size != *pbitofs it fixes this bug.
#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
However this would not fix the results where you expand a bitfield around 3 bytes.
clang produces the 3 bytes if you try and expand around.
#include <stdint.h>
#include <stdio.h>
typedef struct testA{
uint8_t a0 : 7;
uint8_t a1 : 7;
uint8_t a2 : 7;
uint8_t a3 : 3;
} __attribute__((packed)) testA;
int main(){
printf("%d\n", sizeof(testA)); /* Prints out 3 */
return 0;
}
python prints out a size of 4. |
|
Date |
User |
Action |
Args |
2020-03-05 16:19:19 | thesamprice | set | recipients:
+ thesamprice, amaury.forgeotdarc, belopolsky, meador.inge, eryksun, ztane, Charles Machalow, mleroy003, shihai1991, karlding |
2020-03-05 16:19:19 | thesamprice | set | messageid: <1583425159.02.0.416151613526.issue29753@roundup.psfhosted.org> |
2020-03-05 16:19:18 | thesamprice | link | issue29753 messages |
2020-03-05 16:19:18 | thesamprice | create | |
|