diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-05-27 16:33:14 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-05-27 16:33:14 -0400 |
| commit | 937a559e7f1e83391769f3c367ea902df540f4ab (patch) | |
| tree | e77842f3888d13cdfad0a1cdb36cdae82ec89eb7 /compile.c | |
| parent | 6bd755eb24c9a81cf9204028168039c4297a4f68 (diff) | |
Bugfix for void thunks
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1528,7 +1528,8 @@ CORD compile(env_t *env, ast_t *ast) // Find which variables are captured in the closure: env_t *tmp_scope = fresh_scope(body_scope); for (ast_list_t *stmt = Match(lambda->body, Block)->statements; stmt; stmt = stmt->next) { - if (stmt->next) + type_t *stmt_type = get_type(tmp_scope, stmt->ast); + if (stmt->next || (stmt_type->tag == VoidType || stmt_type->tag == AbortType)) (void)compile_statement(tmp_scope, stmt->ast); else (void)compile(tmp_scope, stmt->ast); |
