mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 06:23:39 +00:00
runtime: add Windows vectored exception handler for recoverable panics
Register a vectored exception handler at startup so Windows hardware exceptions can be translated into Go panics. Access violations become nil pointer panics, and integer divide-by-zero exceptions become divide by zero panics, allowing defer/recover to handle them like ordinary runtime panics.
This commit is contained in:
@@ -485,6 +485,8 @@ func defaultTarget(options *Options) (*TargetSpec, error) {
|
||||
"--no-insert-timestamp",
|
||||
"--no-dynamicbase",
|
||||
)
|
||||
spec.ExtraFiles = append(spec.ExtraFiles,
|
||||
"src/runtime/runtime_windows.c")
|
||||
case "wasm", "wasip1", "wasip2":
|
||||
return nil, fmt.Errorf("GOOS=%s but GOARCH is unset. Please set GOARCH to wasm", options.GOOS)
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user