]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: remove redundant conversion
authorDan Kortschak <dan@kortschak.io>
Sun, 16 Oct 2022 09:30:42 +0000 (20:00 +1030)
committerGopher Robot <gobot@golang.org>
Mon, 17 Oct 2022 04:41:37 +0000 (04:41 +0000)
This appears to have been left over from a C cast during the rewrite of
malloc into Go in https://golang.org/cl/108840046.

Change-Id: I88f212089c2bcf79d5881b3e8bf3f94f343331d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/443235
Run-TryBot: Dan Kortschak <dan@kortschak.io>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/runtime/malloc.go

index 53184615a19adcc34486eabedb6ad10831fcdc08..cece04eecaac45188e197a49b0db5fc83276c43b 100644 (file)
@@ -1043,7 +1043,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
                        }
                        x = unsafe.Pointer(v)
                        if needzero && span.needzero != 0 {
-                               memclrNoHeapPointers(unsafe.Pointer(v), size)
+                               memclrNoHeapPointers(x, size)
                        }
                }
        } else {