aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/analyzer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/analyzer.c b/src/analyzer.c
index f665d4c..b16a2eb 100644
--- a/src/analyzer.c
+++ b/src/analyzer.c
@@ -215,9 +215,11 @@ analyzedecl(struct azctx ctx, scope_t *scps, type_t *types, ast_t ast,
} else
ni = fwdnode(ast, i);
- if (ltype.kind == TYPE_UNSET)
+ if (ltype.kind == TYPE_UNSET) {
ltype = rtype;
- else if (!typecompat(ltype, rtype))
+ if (ast.kinds[i] == ASTDECL && rtype.size == 0)
+ ltype.size = 8;
+ } else if (!typecompat(ltype, rtype))
err("analyzer: Type mismatch");
types[i] = ltype;