mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 03:24:00 +00:00
runtime/unix: panic: call abort() instead of exit(2)
abort() will cause gdb to show a backtrace when running inside the debugger, and abort() seems more appropriate anyway for critical errors.
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
|||||||
func _Cfunc_putchar(c int) int
|
func _Cfunc_putchar(c int) int
|
||||||
func _Cfunc_usleep(usec uint) int
|
func _Cfunc_usleep(usec uint) int
|
||||||
func _Cfunc_calloc(nmemb, size uintptr) unsafe.Pointer
|
func _Cfunc_calloc(nmemb, size uintptr) unsafe.Pointer
|
||||||
func _Cfunc_exit(status int)
|
func _Cfunc_abort()
|
||||||
func _Cfunc_clock_gettime(clk_id uint, ts *timespec)
|
func _Cfunc_clock_gettime(clk_id uint, ts *timespec)
|
||||||
|
|
||||||
type timeUnit int64
|
type timeUnit int64
|
||||||
@@ -52,7 +52,7 @@ func ticks() timeUnit {
|
|||||||
|
|
||||||
func abort() {
|
func abort() {
|
||||||
// panic() exits with exit code 2.
|
// panic() exits with exit code 2.
|
||||||
_Cfunc_exit(2)
|
_Cfunc_abort()
|
||||||
}
|
}
|
||||||
|
|
||||||
func alloc(size uintptr) unsafe.Pointer {
|
func alloc(size uintptr) unsafe.Pointer {
|
||||||
|
|||||||
Reference in New Issue
Block a user