diff --git a/src/cmd/compile/internal/ssa/writebarrier.go b/src/cmd/compile/internal/ssa/writebarrier.go index f0eceb7abe8..d6af3578d0a 100644 --- a/src/cmd/compile/internal/ssa/writebarrier.go +++ b/src/cmd/compile/internal/ssa/writebarrier.go @@ -494,36 +494,36 @@ func wbcall(pos src.XPos, b *Block, fn, typ *obj.LSym, ptr, val, mem, sp, sb *Va if typ != nil { // for typedmemmove taddr := b.NewValue1A(pos, OpAddr, b.Func.Config.Types.Uintptr, typ, sb) argTypes = append(argTypes, b.Func.Config.Types.Uintptr) + off = round(off, taddr.Type.Alignment()) if inRegs { wbargs = append(wbargs, taddr) } else { - off = round(off, taddr.Type.Alignment()) arg := b.NewValue1I(pos, OpOffPtr, taddr.Type.PtrTo(), off, sp) mem = b.NewValue3A(pos, OpStore, types.TypeMem, ptr.Type, arg, taddr, mem) - off += taddr.Type.Size() } + off += taddr.Type.Size() } argTypes = append(argTypes, ptr.Type) + off = round(off, ptr.Type.Alignment()) if inRegs { wbargs = append(wbargs, ptr) } else { - off = round(off, ptr.Type.Alignment()) arg := b.NewValue1I(pos, OpOffPtr, ptr.Type.PtrTo(), off, sp) mem = b.NewValue3A(pos, OpStore, types.TypeMem, ptr.Type, arg, ptr, mem) - off += ptr.Type.Size() } + off += ptr.Type.Size() if val != nil { argTypes = append(argTypes, val.Type) + off = round(off, val.Type.Alignment()) if inRegs { wbargs = append(wbargs, val) } else { - off = round(off, val.Type.Alignment()) arg := b.NewValue1I(pos, OpOffPtr, val.Type.PtrTo(), off, sp) mem = b.NewValue3A(pos, OpStore, types.TypeMem, val.Type, arg, val, mem) - off += val.Type.Size() } + off += val.Type.Size() } off = round(off, config.PtrSize) wbargs = append(wbargs, mem)