aboutsummaryrefslogtreecommitdiff
path: root/semantics.c
diff options
context:
space:
mode:
authorTeddy <[email protected]>2014-04-06 15:56:26 +0800
committerTeddy <[email protected]>2014-04-06 15:56:26 +0800
commit6d4fff31616fdc96da20898d39d7cba95a9cda0a (patch)
treeed7876a8043d8893875680283fbe109251ac8d3c /semantics.c
parent8f8927e3f240ea6710337b1351ea8adee9eef2db (diff)
bugfix: global incomplete type should not be allowed
Diffstat (limited to 'semantics.c')
-rw-r--r--semantics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/semantics.c b/semantics.c
index 39ca0c1..1d9e329 100644
--- a/semantics.c
+++ b/semantics.c
@@ -596,7 +596,7 @@ CVar_t semantics_decl(CNode *p, CScope_t scope) {
{
/* TODO: initializer checking */
CVar_t var = semantics_declr(p->chd, type, scope, 0);
- if (scope->lvl && !type_is_complete(var->type))
+ if (!type_is_complete(var->type))
{
sprintf(err_buff, "storage size of '%s' isn’t known", var->name);
ERROR(var->ast);