mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
runtime: make fatal failures unrecoverable
Match the Go runtime by terminating for deadlocks, stack overflows, runtime and GC invariants, invalid lock operations, and platform initialization failures instead of routing them through panic/recover. Keep language-level runtime errors and unsupported user operations recoverable. Add crash coverage that verifies fatal errors bypass deferred recover calls.
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import "sync"
|
||||
|
||||
func main() {
|
||||
defer func() {
|
||||
println("recovered:", recover())
|
||||
}()
|
||||
|
||||
var mutex sync.Mutex
|
||||
mutex.Unlock()
|
||||
}
|
||||
Reference in New Issue
Block a user