Skip to content

Commit adb1bce

Browse files
consensus/ethash: only use *reflect.SliceHeader, not reflect.SliceHeader. See comment here: https://github.com/golang/go/issues/40397\#issuecomment-663748689
1 parent e997f92 commit adb1bce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

consensus/ethash/algorithm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ func generateCache(dest []uint32, epoch uint64, seed []byte) {
151151
logFn("Generated ethash verification cache", "elapsed", common.PrettyDuration(elapsed))
152152
}()
153153
// Convert our destination slice to a byte buffer
154-
header := *(*reflect.SliceHeader)(unsafe.Pointer(&dest))
154+
header := (*reflect.SliceHeader)(unsafe.Pointer(&dest))
155155
header.Len *= 4
156156
header.Cap *= 4
157-
cache := *(*[]byte)(unsafe.Pointer(&header))
157+
cache := *(*[]byte)(unsafe.Pointer(header))
158158

159159
// Calculate the number of theoretical rows (we'll store in one buffer nonetheless)
160160
size := uint64(len(cache))

0 commit comments

Comments
 (0)