summaryrefslogtreecommitdiff
path: root/src/runtime/cgocall.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2019-10-02 15:41:13 -0700
committerMatthew Dempsky <mdempsky@google.com>2019-10-03 02:09:41 +0000
commit64e598f7837566802085ba9bb684e82ccbcf7ca6 (patch)
treec792dea315da3ae0a7a07e3a96a85846d795eef4 /src/runtime/cgocall.go
parentdebbb1e78d08b201313c83f2d236de90d8444c8e (diff)
downloadgo-git-64e598f7837566802085ba9bb684e82ccbcf7ca6.tar.gz
runtime: use efaceOf where applicable
Prepared with gofmt -r. Change-Id: Ifea325c209d800b5692d318955930b10debb548b Reviewed-on: https://go-review.googlesource.com/c/go/+/198494 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/cgocall.go')
-rw-r--r--src/runtime/cgocall.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go
index 3595e49ed5..5f8ff8139a 100644
--- a/src/runtime/cgocall.go
+++ b/src/runtime/cgocall.go
@@ -411,7 +411,7 @@ func cgoCheckPointer(ptr interface{}, arg interface{}) {
return
}
- ep := (*eface)(unsafe.Pointer(&ptr))
+ ep := efaceOf(&ptr)
t := ep._type
top := true
@@ -423,7 +423,7 @@ func cgoCheckPointer(ptr interface{}, arg interface{}) {
if p == nil || !cgoIsGoPointer(p) {
return
}
- aep := (*eface)(unsafe.Pointer(&arg))
+ aep := efaceOf(&arg)
switch aep._type.kind & kindMask {
case kindBool:
if t.kind&kindMask == kindUnsafePointer {
@@ -650,7 +650,7 @@ func cgoCheckResult(val interface{}) {
return
}
- ep := (*eface)(unsafe.Pointer(&val))
+ ep := efaceOf(&val)
t := ep._type
cgoCheckArg(t, ep.data, t.kind&kindDirectIface == 0, false, cgoResultFail)
}