diff options
Diffstat (limited to 'src/runtime/malloc.go')
| -rw-r--r-- | src/runtime/malloc.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 398eaf5d52..c7ab928fe6 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -1153,7 +1153,8 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer { memclrNoHeapPointers(x, size) } if goexperiment.AllocHeaders && hasHeader { - header = (**_type)(unsafe.Pointer(uintptr(v) + size - mallocHeaderSize)) + header = (**_type)(x) + x = add(x, mallocHeaderSize) size -= mallocHeaderSize } } |
