mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +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:
@@ -29,7 +29,7 @@ func findGlobals(found func(start, end uintptr)) {
|
||||
// it using GetModuleHandle to account for ASLR etc.
|
||||
result := _GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, nil, &module)
|
||||
if gcAsserts && (!result || module.signature != 0x5A4D) { // 0x4D5A is "MZ"
|
||||
runtimePanic("cannot get module handle")
|
||||
runtimeFatal("cannot get module handle")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user