From 0085c648f6e9f016f937107ce68651987b001ddf Mon Sep 17 00:00:00 2001 From: grischka Date: Mon, 6 Jul 2009 21:10:14 +0200 Subject: bcheck: restore malloc hooks when done --- tcc.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'tcc.c') diff --git a/tcc.c b/tcc.c index 9746f9f..daa1013 100644 --- a/tcc.c +++ b/tcc.c @@ -529,23 +529,20 @@ int main(int argc, char **argv) /* free all files */ tcc_free(files); - if (ret) - goto the_end; - - if (do_bench) - tcc_print_stats(s, getclock_us() - start_time); + if (0 == ret) { + if (do_bench) + tcc_print_stats(s, getclock_us() - start_time); + + if (s->output_type == TCC_OUTPUT_PREPROCESS) { + if (outfile) + fclose(s->outfile); + } else if (s->output_type == TCC_OUTPUT_MEMORY) + ret = tcc_run(s, argc - optind, argv + optind); + else + ret = tcc_output_file(s, outfile) ? 1 : 0; + } - if (s->output_type == TCC_OUTPUT_PREPROCESS) { - if (outfile) - fclose(s->outfile); - } else if (s->output_type == TCC_OUTPUT_MEMORY) { - ret = tcc_run(s, argc - optind, argv + optind); - } else - ret = tcc_output_file(s, outfile) ? 1 : 0; - the_end: - /* XXX: cannot do it with bound checking because of the malloc hooks */ - if (!s->do_bounds_check) - tcc_delete(s); + tcc_delete(s); #ifdef MEM_DEBUG if (do_bench) { @@ -554,4 +551,3 @@ int main(int argc, char **argv) #endif return ret; } - -- cgit v1.3.1