diff --git a/frontend/cmd/compile.c b/frontend/cmd/compile.c index f960a25..1aa0207 100644 --- a/frontend/cmd/compile.c +++ b/frontend/cmd/compile.c @@ -82,7 +82,7 @@ static int compile_file(const char *path, const b_arglist *args) if (status != IVY_OK) { b_err("failed to initialise Ivy code generator"); - ivy_parser_destroy(parser); + ivy_parser_destroy(parser, NULL); ivy_lexer_destroy(lex); ivy_file_close(src); return -1; @@ -146,12 +146,12 @@ static int compile_file(const char *path, const b_arglist *args) } if (r != 0) { - ivy_parser_destroy(parser); + ivy_parser_destroy(parser, NULL); return r; } if (!show_ir) { - ivy_parser_destroy(parser); + ivy_parser_destroy(parser, NULL); return 0; } @@ -175,10 +175,11 @@ static int compile_file(const char *path, const b_arglist *args) mie_ir_converter_set_dest_file(convert, stdout); mie_ir_converter_process(convert); + mie_value_destroy(MIE_VALUE(mod)); mie_ir_converter_destroy(convert); ivy_codegen_destroy(codegen); - ivy_parser_destroy(parser); + ivy_parser_destroy(parser, NULL); return r; } diff --git a/frontend/cmd/repl.c b/frontend/cmd/repl.c index 727678f..230aebd 100644 --- a/frontend/cmd/repl.c +++ b/frontend/cmd/repl.c @@ -101,7 +101,7 @@ static void repl_destroy(struct repl *repl) } if (repl->r_parse) { - ivy_parser_destroy(repl->r_parse); + ivy_parser_destroy(repl->r_parse, NULL); } if (repl->r_lex) {