summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-02-02 22:33:56 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-02-02 22:33:56 -0500
commit0a2322c338093affdbca8c5ad6f038a54d79a5e5 (patch)
treeb66eec06b9846148da4807bb8089e8bac255b523 /cgen.c
parentae47cf5b2c8991e21f0445a34f6960afa3f25e4e (diff)
more namespaces
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cgen.c b/cgen.c
index c5be2d5..b37d432 100644
--- a/cgen.c
+++ b/cgen.c
@@ -199,6 +199,9 @@ static bool cgen_defs_decl(CGenerator *g, Declaration *d);
static bool cgen_block_enter(CGenerator *g, Block *b) {
g->block = b;
+ if (b->flags & BLOCK_IS_NMS) {
+ return true;
+ }
Statement *stmts;
if (b == NULL) {
stmts = g->file->stmts;
@@ -2069,8 +2072,6 @@ static bool cgen_stmt(CGenerator *g, Statement *s) {
}
static bool cgen_defs_fn(CGenerator *g, FnExpr *f, Type *t) {
- if (f->c.defined) return true;
- f->c.defined = true;
FnType *fn_type = &t->fn;
bool any_const = false;
if (fn_type->constness) {