This is to fix bug 35164.
The following program shows the issue:
struct ASTRUCT;
extern struct ASTRUCT g_struct;
int main()
{
return &g_struct;
}
In this program there is no size information associated with the ASTRUCT type, yet the code unconditionally tries to emit sizes for globals causing an assert. This change respects this scenario. I've tested and linked a simple test file.
Note however I'm very new to this code so a cautious eye in reviewing this would be appreciated.