summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgen.c5
-rw-r--r--main.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/cgen.c b/cgen.c
index c9209c5..8389ced 100644
--- a/cgen.c
+++ b/cgen.c
@@ -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: {
diff --git a/main.c b/main.c
index c0b37fc..84a06cf 100644
--- a/main.c
+++ b/main.c
@@ -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);
}