]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Fixed failing code generation test
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 22 Oct 2014 12:20:31 +0000 (08:20 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 22 Oct 2014 12:20:31 +0000 (08:20 -0400)
source/sclpl/codegen.c
source/sclpl/main.c

index 31d286530e803fd475679e6282d6a20ae7c64c8a..9fe250e752d520315c84538ee28cb694f49479f6 100644 (file)
@@ -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) {
index 0b92afa5ba5b82bb0da367c2283609058be3e784..53021216d8f8cdd2dada0695ffdd81aeeff724cb 100644 (file)
@@ -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;
 }