Skip to content

Commit 399454f

Browse files
authored
builtin: flush stdout on panic (#24606)
1 parent d6a2a5e commit 399454f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vlib/builtin/builtin.c.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) {
7373
eprint(' v hash: '); eprintln(vcurrent_hash())
7474
eprintln('=========================================')
7575
// vfmt on
76+
flush_stdout()
7677
$if native {
7778
C.exit(1) // TODO: native backtraces
7879
} $else $if exit_after_panic_message ? {
@@ -132,6 +133,7 @@ pub fn panic(s string) {
132133
eprintln(s)
133134
eprint('v hash: ')
134135
eprintln(vcurrent_hash())
136+
flush_stdout()
135137
$if native {
136138
C.exit(1) // TODO: native backtraces
137139
} $else $if exit_after_panic_message ? {

0 commit comments

Comments
 (0)