Skip to content

Commit 498c8cf

Browse files
committed
builtin: skip print_backtraces on panics with tcc, it does it automatically
1 parent 9b4c81e commit 498c8cf

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

vlib/builtin/builtin.v

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,20 @@ fn panic_debug(line_no int, file, mod, fn_name, s string) {
4343
eprintln(' file: $file')
4444
eprintln(' line: ' + line_no.str())
4545
eprintln('=========================================')
46-
print_backtrace_skipping_top_frames(1)
46+
// recent versions of tcc print better backtraces automatically
47+
$if !tinyc {
48+
print_backtrace_skipping_top_frames(1)
49+
}
4750
break_if_debugger_attached()
4851
C.exit(1)
4952
}
5053

5154
pub fn panic(s string) {
5255
eprintln('V panic: $s')
53-
print_backtrace()
56+
// recent versions of tcc print better backtraces automatically
57+
$if !tinyc {
58+
print_backtrace()
59+
}
5460
break_if_debugger_attached()
5561
C.exit(1)
5662
}

0 commit comments

Comments
 (0)