diff options
-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); } |