From 399454fb89031285dd4c5cae3e0092e5f8003c91 Mon Sep 17 00:00:00 2001 From: "Eliyaan (Nopana)" <103932369+Eliyaan@users.noreply.github.com> Date: Fri, 30 May 2025 04:40:29 +0200 Subject: [PATCH] builtin: flush stdout on panic (#24606) --- vlib/builtin/builtin.c.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vlib/builtin/builtin.c.v b/vlib/builtin/builtin.c.v index 6affed9d04..8c894db269 100644 --- a/vlib/builtin/builtin.c.v +++ b/vlib/builtin/builtin.c.v @@ -73,6 +73,7 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) { eprint(' v hash: '); eprintln(vcurrent_hash()) eprintln('=========================================') // vfmt on + flush_stdout() $if native { C.exit(1) // TODO: native backtraces } $else $if exit_after_panic_message ? { @@ -132,6 +133,7 @@ pub fn panic(s string) { eprintln(s) eprint('v hash: ') eprintln(vcurrent_hash()) + flush_stdout() $if native { C.exit(1) // TODO: native backtraces } $else $if exit_after_panic_message ? {