mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 06:53:40 +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:
@@ -80,7 +80,7 @@ func findGlobals(found func(start, end uintptr)) {
|
||||
|
||||
// Sanity check that we're actually looking at a MachO header.
|
||||
if gcAsserts && libc_mh_execute_header.magic != MH_MAGIC_64 {
|
||||
runtimePanic("gc: unexpected MachO header")
|
||||
runtimeFatal("gc: unexpected MachO header")
|
||||
}
|
||||
|
||||
// Iterate through the load commands.
|
||||
@@ -106,7 +106,7 @@ func findGlobals(found func(start, end uintptr)) {
|
||||
// Note that when ASLR is disabled (for example, when
|
||||
// running inside lldb), the offset is zero. That's why we
|
||||
// need a separate hasOffset for this assert.
|
||||
runtimePanic("gc: did not detect ASLR offset")
|
||||
runtimeFatal("gc: did not detect ASLR offset")
|
||||
}
|
||||
// Scan this segment for GC roots.
|
||||
// This could be improved by only reading the memory areas
|
||||
|
||||
Reference in New Issue
Block a user