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:
|
case *Error:
|
||||||
err = t
|
err = t
|
||||||
case string:
|
case string:
|
||||||
errRuntimePanic.Message = t
|
panicString(t)
|
||||||
err = errRuntimePanic
|
return
|
||||||
case error:
|
case error:
|
||||||
errRuntimePanic.Message = t.Error()
|
errRuntimePanic.Message = t.Error()
|
||||||
err = errRuntimePanic
|
err = errRuntimePanic
|
||||||
@ -39,3 +39,10 @@ func Panic(e interface{}) {
|
|||||||
|
|
||||||
cpuHaltFn()
|
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