diff --git a/src/runtime/mbarrier.go b/src/runtime/mbarrier.go index c446db93d2..b6c5ee0658 100644 --- a/src/runtime/mbarrier.go +++ b/src/runtime/mbarrier.go @@ -154,6 +154,9 @@ import ( // //go:nosplit func typedmemmove(typ *_type, dst, src unsafe.Pointer) { + if dst == src { + return + } if typ.kind&kindNoPointers == 0 { bulkBarrierPreWrite(uintptr(dst), uintptr(src), typ.size) }