diff options
| author | grischka <grischka> | 2009-07-06 21:10:14 +0200 |
|---|---|---|
| committer | unknown <gr@.(none)> | 2009-07-18 21:54:47 +0200 |
| commit | 0085c648f6e9f016f937107ce68651987b001ddf (patch) | |
| tree | c2cec73325d4890889747ca00e27089583fb7264 /tcc.c | |
| parent | c93ddac9aa466f11750be3f230e097c207104349 (diff) | |
| download | tinycc-0085c648f6e9f016f937107ce68651987b001ddf.tar.gz tinycc-0085c648f6e9f016f937107ce68651987b001ddf.tar.bz2 | |
bcheck: restore malloc hooks when done
Diffstat (limited to 'tcc.c')
| -rw-r--r-- | tcc.c | 28 |
1 files changed, 12 insertions, 16 deletions
@@ -529,23 +529,20 @@ int main(int argc, char **argv) /* free all files */ tcc_free(files); - if (ret) - goto the_end; + if (0 == ret) { + if (do_bench) + tcc_print_stats(s, getclock_us() - start_time); - 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; } - |
