summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cgen.c b/cgen.c
index 0de47dd..5d97d11 100644
--- a/cgen.c
+++ b/cgen.c
@@ -1861,7 +1861,7 @@ static bool cgen_decl(CGenerator *g, Declaration *d) {
cgen_write(g, "; ");
}
if (has_expr) {
- assert(g->block && !(d->flags & DECL_IS_CONST));
+ assert((g->block || g->fn) && !(d->flags & DECL_IS_CONST));
if (!cgen_expr_pre(g, &d->expr)) return false;
if (d->expr.type.kind == TYPE_TUPLE) {
if (!cgen_set_tuple(g, NULL, d->idents, NULL, &d->expr)) return false;