Ensure struct params are small enough to fit in the param slots.

This commit is contained in:
Bill Currie 2010-11-17 00:26:41 +09:00
parent 624a1630f3
commit e5e560cbaf

View file

@ -146,6 +146,10 @@ parse_params (type_t *type, param_t *parms)
}
new.num_parms = -(new.num_parms + 1);
} else if (p->type) {
if (type_size (p->type) > type_size (&type_param)) {
error (0, "param too large to be passed by value");
return type;
}
new.parm_types[new.num_parms] = p->type;
new.num_parms++;
}