From: Michael D. Lowis Date: Wed, 22 Oct 2014 12:20:31 +0000 (-0400) Subject: Fixed failing code generation test X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=683fa16903e1816b787f14743643a041dfa6a8e2;p=proto%2Fsclpl.git Fixed failing code generation test --- diff --git a/source/sclpl/codegen.c b/source/sclpl/codegen.c index 31d2865..9fe250e 100644 --- a/source/sclpl/codegen.c +++ b/source/sclpl/codegen.c @@ -215,9 +215,8 @@ static void emit_fn_definitions(FILE* file, vec_t* fnlst) { emit_expression(file, fnlst, (tree_t*)vec_at(body,i), 1); fprintf(file, ";\n"); } - fputs("}\n", file); + fputs("}\n\n", file); } - fputs("\n", file); } static void emit_toplevel(FILE* file, vec_t* fnlst, vec_t* prgrm) { diff --git a/source/sclpl/main.c b/source/sclpl/main.c index 0b92afa..5302121 100644 --- a/source/sclpl/main.c +++ b/source/sclpl/main.c @@ -183,7 +183,8 @@ int translate(str_t* in, str_t* out) { fclose(input); fclose(output); - mem_release(out); + if (NULL != out) + mem_release(out); return ret; }