diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-02 18:45:35 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-02 18:45:35 -0500 |
commit | 5d567155b94b71cb247f13d381fcfedb7a30042c (patch) | |
tree | b1fdada2d5a23a27cd8fc059b116001a7a983cdf | |
parent | 3fa921a38b2c8440d22b2613106db469340984fa (diff) |
fixed problem with #C
-rw-r--r-- | cgen.c | 5 | ||||
-rw-r--r-- | main.c | 5 |
2 files changed, 7 insertions, 3 deletions
@@ -1394,9 +1394,10 @@ static bool cgen_expr(CGenerator *g, Expression *e) { } break; case EXPR_C: { - assert(e->kind == EXPR_VAL); + Expression *code = e->c.code; + assert(code->kind == EXPR_VAL); cgen_indent(g); - fwrite(e->val.slice.data, 1, (size_t)e->val.slice.n, cgen_writing_to(g)); + fwrite(code->val.slice.data, 1, (size_t)code->val.slice.n, cgen_writing_to(g)); } break; case EXPR_DSIZEOF: case EXPR_DALIGNOF: { @@ -129,9 +129,10 @@ int main(int argc, char **argv) { typer_create(&tr, &ev, &main_allocr); tr.exptr = &exptr; +#ifdef TOC_DEBUG FILE *out_pkg = fopen("out.top", "wb"); exptr_create(&exptr, out_pkg); - +#endif if (!block_enter(NULL, f.stmts, SCOPE_CHECK_REDECL)) /* enter global scope */ return false; @@ -162,7 +163,9 @@ int main(int argc, char **argv) { evalr_free(&ev); fclose(out); +#ifdef TOC_DEBUG fclose(out_pkg); +#endif idents_free(&file_idents); } |