builtin: flush stdout on panic (#24606)

This commit is contained in:
Eliyaan (Nopana) 2025-05-30 04:40:29 +02:00 committed by GitHub
parent d6a2a5e925
commit 399454fb89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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()) eprint(' v hash: '); eprintln(vcurrent_hash())
eprintln('=========================================') eprintln('=========================================')
// vfmt on // vfmt on
flush_stdout()
$if native { $if native {
C.exit(1) // TODO: native backtraces C.exit(1) // TODO: native backtraces
} $else $if exit_after_panic_message ? { } $else $if exit_after_panic_message ? {
@ -132,6 +133,7 @@ pub fn panic(s string) {
eprintln(s) eprintln(s)
eprint('v hash: ') eprint('v hash: ')
eprintln(vcurrent_hash()) eprintln(vcurrent_hash())
flush_stdout()
$if native { $if native {
C.exit(1) // TODO: native backtraces C.exit(1) // TODO: native backtraces
} $else $if exit_after_panic_message ? { } $else $if exit_after_panic_message ? {