From 2be0c6af47eb778767d0f1ae55bd3583175e5e1a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 6 Dec 2020 14:20:22 +0200 Subject: [PATCH] builtin: implement -d exit_after_panic_message (speeds up `v test-parser` with gcc/clang) --- vlib/builtin/builtin.v | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 66d5963917..ee8e20b642 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -48,6 +48,9 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) { eprintln(' file: $file') eprintln(' line: ' + line_no.str()) eprintln('=========================================') + $if exit_after_panic_message ? { + C.exit(1) + } // recent versions of tcc print better backtraces automatically $if !tinyc { print_backtrace_skipping_top_frames(1) @@ -58,6 +61,9 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) { pub fn panic(s string) { eprintln('V panic: $s') + $if exit_after_panic_message ? { + C.exit(1) + } // recent versions of tcc print better backtraces automatically $if !tinyc { print_backtrace()