]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Fixed a memory leak
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 15 Oct 2014 02:05:07 +0000 (22:05 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 15 Oct 2014 02:05:07 +0000 (22:05 -0400)
source/sclpl/codegen.c
spec/parser_spec.rb

index 2c91fc1ca65301ab6ccd9a0135cc54647aef6831..071a491d163ffdc29ec1fea06ab37cad94fdc557 100644 (file)
@@ -258,5 +258,6 @@ void codegen_csource(FILE* file, vec_t* program) {
     emit_fn_declarations(funcs);
     emit_fn_definitions(funcs);
     emit_toplevel(funcs, program);
+    mem_release(funcs);
     emit_footer();
 }
index 1bda7f6bc3fb408d2837e13e9423e44069e81255..0e715a06a31b035043144e942528be66692a6287 100644 (file)
@@ -21,7 +21,6 @@ def ast(input)
   out, err, status = Open3.capture3('./build/bin/sclpl-test', '--ast', :stdin_data => input)
   raise err unless err == ""
   raise "Parser command returned non-zero status" unless status.success?
-  #out.gsub!(/<tok (T_[A-Z]+)>/,'\1')
   out.gsub!(/([()])|tree/,' \1 ')
   off, expr = re_structure(out.split)
   expr