summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-04-01 17:39:47 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-04-01 17:39:47 -0400
commit157ffb0e7c17c61d05462e5ffdce19620485b0b1 (patch)
tree1c8d5f1583a2b247ddb6a12ef23d2f3bed253e92 /cgen.c
parent8b93c704d059609f9ba8e3d946a9dc722e72318e (diff)
block cleanup
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 6d03947..f84474a 100644
--- a/cgen.c
+++ b/cgen.c
@@ -256,7 +256,7 @@ static inline void cgen_writeln(CGenerator *g, const char *fmt, ...) {
/* should this declaration be a direct function declaration C? (as opposed to using a function pointer or not being a function) */
static bool cgen_fn_is_direct(CGenerator *g, Declaration *d) {
- return (g->block == NULL || (g->block->flags & BLOCK_IS_NMS)) && (d->flags & DECL_HAS_EXPR) && d->expr.kind == EXPR_FN && arr_len(d->idents) == 1;
+ return g->fn == NULL && (d->flags & DECL_HAS_EXPR) && d->expr.kind == EXPR_FN && arr_len(d->idents) == 1;
}
static bool fn_has_instances(FnExpr *f) {