Actions
Bug #3435
openNeither aspectator nor C back-end support variable arrays as field type
Start date:
09/12/2012
Due date:
% Done:
0%
Estimated time:
Detected in build:
svn
Platform:
Published in build:
Description
So, the given code (based on real driver drivers/usb/gadget/g_ffs.c):
void *malloc(int size);
int func(int a)
{
struct
{
int x[a];
} *d;
d = malloc(sizeof *d);
}
lead to segmentation fault in CIF and to incorrect code printed by c-backend (if the last is used standalone):
int func(int a)
{
ldv_1602;
ldv_1602;
ldv_1602 *d;
d = ( ldv_1602 *) malloc ( ( int ) ( ( unsigned int ) ( a ) * 4U ) );
}
Actions