diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2020-01-07 23:13:24 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2020-01-07 23:13:24 +0000 |
commit | 81f025b580be6ce933f0ecb1f96445a3bb4fff4b (patch) | |
tree | 593e3698208109bb3b3071e6498865ec327c4f34 /libgo/go | |
parent | 7010bcd1c80e2a89f43c064ba21289df8c67a84c (diff) | |
download | gcc-81f025b580be6ce933f0ecb1f96445a3bb4fff4b.zip gcc-81f025b580be6ce933f0ecb1f96445a3bb4fff4b.tar.gz gcc-81f025b580be6ce933f0ecb1f96445a3bb4fff4b.tar.bz2 |
compiler, runtime: stop using __go_runtime_error
Use specific panic functions instead, which are mostly already in the
runtime package.
Also correct "defer nil" to panic when we execute the defer, rather
than throw when we queue it.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/213642
From-SVN: r279979
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/runtime/panic.go | 2 | ||||
-rw-r--r-- | libgo/go/runtime/proc.go | 8 | ||||
-rw-r--r-- | libgo/go/runtime/slice.go | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/libgo/go/runtime/panic.go b/libgo/go/runtime/panic.go index 2a11f932..9667181 100644 --- a/libgo/go/runtime/panic.go +++ b/libgo/go/runtime/panic.go @@ -38,6 +38,8 @@ import ( //go:linkname goPanicSlice3BU //go:linkname goPanicSlice3C //go:linkname goPanicSlice3CU +//go:linkname panicshift +//go:linkname panicdivide //go:linkname panicmem // Temporary for C code to call: //go:linkname throw diff --git a/libgo/go/runtime/proc.go b/libgo/go/runtime/proc.go index a0147cf..a025137 100644 --- a/libgo/go/runtime/proc.go +++ b/libgo/go/runtime/proc.go @@ -3157,6 +3157,14 @@ func syscall_runtime_AfterExec() { execLock.unlock() } +// panicgonil is used for gccgo as we need to use a compiler check for +// a nil func, in case we have to build a thunk. +//go:linkname panicgonil +func panicgonil() { + getg().m.throwing = -1 // do not dump full stacks + throw("go of nil func value") +} + // Create a new g running fn passing arg as the single argument. // Put it on the queue of g's waiting to run. // The compiler turns a go statement into a call to this. diff --git a/libgo/go/runtime/slice.go b/libgo/go/runtime/slice.go index c258ebd..49d5a86 100644 --- a/libgo/go/runtime/slice.go +++ b/libgo/go/runtime/slice.go @@ -12,6 +12,8 @@ import ( // For gccgo, use go:linkname to export compiler-called functions. // +//go:linkname panicmakeslicelen +//go:linkname panicmakeslicecap //go:linkname makeslice //go:linkname makeslice64 //go:linkname growslice |