Fix ICE after incomplete type error

Attempting to define a variable with an incomplete type is an error, and
results in a default size 1 of allocated, but I forgot to set default
alignment when implementing alignment.
This commit is contained in:
Bill Currie 2020-02-23 23:46:47 +09:00
parent f387b9aa47
commit 27ae5ccfce

View file

@ -153,6 +153,7 @@ new_def (const char *name, type_t *type, defspace_t *space,
if (!size) {
error (0, "%s has incomplete type", name);
size = 1;
alignment = 1;
}
if (alignment < 1) {
print_type (type);