Skip to content

Commit

Permalink
interp: fix unsafe2 to work on 32 bits architectures
Browse files Browse the repository at this point in the history
Fixes #1279.
  • Loading branch information
mvertes authored Oct 11, 2021
1 parent b1a758d commit 4e06abe
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions internal/unsafe2/unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ type dummy struct{}
// DummyType represents a stand-in for a recursive type.
var DummyType = reflect.TypeOf(dummy{})

// the following type sizes must match their original definition in Go src/reflect/type.go.

type rtype struct {
_ [48]byte
_ uintptr
_ uintptr
_ uint32
_ uint32
_ uintptr
_ uintptr
_ uint32
_ uint32
}

type emptyInterface struct {
Expand All @@ -20,14 +29,14 @@ type emptyInterface struct {
}

type structField struct {
_ int64
_ uintptr
typ *rtype
_ uintptr
}

type structType struct {
rtype
_ int64
_ uintptr
fields []structField
}

Expand Down

0 comments on commit 4e06abe

Please sign in to comment.