compiler: implement recover() built-in function

This commit is contained in:
Ayke van Laethem
2021-11-29 14:54:34 +01:00
committed by Ron Evans
parent 79ba6a50c3
commit 8d6b210c09
31 changed files with 868 additions and 191 deletions
+5 -2
View File
@@ -4,6 +4,9 @@ package task
import "unsafe"
// There is only one goroutine so the task struct can be a global.
var mainTask Task
//go:linkname runtimePanic runtime.runtimePanic
func runtimePanic(str string)
@@ -12,8 +15,8 @@ func Pause() {
}
func Current() *Task {
runtimePanic("scheduler is disabled")
return nil
// Return a task struct, which is used for the recover builtin for example.
return &mainTask
}
//go:noinline