mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
Redirect runtime.throw to kernel.Panic via kernel.panicString
This commit is contained in:
parent
ce34763e23
commit
5e5e9f1c0b
@ -23,8 +23,8 @@ func Panic(e interface{}) {
|
||||
case *Error:
|
||||
err = t
|
||||
case string:
|
||||
errRuntimePanic.Message = t
|
||||
err = errRuntimePanic
|
||||
panicString(t)
|
||||
return
|
||||
case error:
|
||||
errRuntimePanic.Message = t.Error()
|
||||
err = errRuntimePanic
|
||||
@ -39,3 +39,10 @@ func Panic(e interface{}) {
|
||||
|
||||
cpuHaltFn()
|
||||
}
|
||||
|
||||
// panicString serves as a redirect target for runtime.throw
|
||||
//go:redirect-from runtime.throw
|
||||
func panicString(msg string) {
|
||||
errRuntimePanic.Message = msg
|
||||
Panic(errRuntimePanic)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user