diff options
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/cgocall.go | 2 | ||||
| -rw-r--r-- | src/runtime/type.go | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go index 69e29ef976..879e786231 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -531,7 +531,7 @@ func cgoCheckArg(t *_type, p unsafe.Pointer, indir, top bool, msg string) { return } for _, f := range st.fields { - cgoCheckArg(f.typ, add(p, f.offset), true, top, msg) + cgoCheckArg(f.typ, add(p, f.offset()), true, top, msg) } case kindPtr, kindUnsafePointer: if indir { diff --git a/src/runtime/type.go b/src/runtime/type.go index 3ecc54c72c..10442eff69 100644 --- a/src/runtime/type.go +++ b/src/runtime/type.go @@ -390,9 +390,13 @@ type ptrtype struct { } type structfield struct { - name name - typ *_type - offset uintptr + name name + typ *_type + offsetAnon uintptr +} + +func (f *structfield) offset() uintptr { + return f.offsetAnon >> 1 } type structtype struct { @@ -650,7 +654,7 @@ func typesEqual(t, v *_type) bool { if tf.name.tag() != vf.name.tag() { return false } - if tf.offset != vf.offset { + if tf.offsetAnon != vf.offsetAnon { return false } } |
