mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
builtin: flush stdout on panic (#24606)
This commit is contained in:
parent
d6a2a5e925
commit
399454fb89
1 changed files with 2 additions and 0 deletions
|
@ -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 ? {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue