diff --git a/src/reflect/value.go b/src/reflect/value.go index e641a7957c4..de01f13825f 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -508,7 +508,7 @@ func (v Value) call(op string, in []Value) []Value { // Copy values to "integer registers." if v.flag&flagIndir != 0 { offset := add(v.ptr, st.offset, "precomputed value offset") - memmove(unsafe.Pointer(®Args.Ints[st.ireg]), offset, st.size) + memmove(regArgs.IntRegArgAddr(st.ireg, st.size), offset, st.size) } else { if st.kind == abiStepPointer { // Duplicate this pointer in the pointer area of the @@ -524,7 +524,7 @@ func (v Value) call(op string, in []Value) []Value { panic("attempted to copy pointer to FP register") } offset := add(v.ptr, st.offset, "precomputed value offset") - memmove(unsafe.Pointer(®Args.Floats[st.freg]), offset, st.size) + memmove(regArgs.FloatRegArgAddr(st.freg, st.size), offset, st.size) default: panic("unknown ABI part kind") } @@ -610,13 +610,13 @@ func (v Value) call(op string, in []Value) []Value { switch st.kind { case abiStepIntReg: offset := add(s, st.offset, "precomputed value offset") - memmove(offset, unsafe.Pointer(®Args.Ints[st.ireg]), st.size) + memmove(offset, regArgs.IntRegArgAddr(st.ireg, st.size), st.size) case abiStepPointer: s := add(s, st.offset, "precomputed value offset") *((*unsafe.Pointer)(s)) = regArgs.Ptrs[st.ireg] case abiStepFloatReg: offset := add(s, st.offset, "precomputed value offset") - memmove(offset, unsafe.Pointer(®Args.Floats[st.freg]), st.size) + memmove(offset, regArgs.FloatRegArgAddr(st.freg, st.size), st.size) case abiStepStack: panic("register-based return value has stack component") default: @@ -698,13 +698,13 @@ func callReflect(ctxt *makeFuncImpl, frame unsafe.Pointer, retValid *bool, regs switch st.kind { case abiStepIntReg: offset := add(v.ptr, st.offset, "precomputed value offset") - memmove(offset, unsafe.Pointer(®s.Ints[st.ireg]), st.size) + memmove(offset, regs.IntRegArgAddr(st.ireg, st.size), st.size) case abiStepPointer: s := add(v.ptr, st.offset, "precomputed value offset") *((*unsafe.Pointer)(s)) = regs.Ptrs[st.ireg] case abiStepFloatReg: offset := add(v.ptr, st.offset, "precomputed value offset") - memmove(offset, unsafe.Pointer(®s.Floats[st.freg]), st.size) + memmove(offset, regs.FloatRegArgAddr(st.freg, st.size), st.size) case abiStepStack: panic("register-based return value has stack component") default: @@ -784,7 +784,7 @@ func callReflect(ctxt *makeFuncImpl, frame unsafe.Pointer, retValid *bool, regs // Copy values to "integer registers." if v.flag&flagIndir != 0 { offset := add(v.ptr, st.offset, "precomputed value offset") - memmove(unsafe.Pointer(®s.Ints[st.ireg]), offset, st.size) + memmove(regs.IntRegArgAddr(st.ireg, st.size), offset, st.size) } else { // Only populate the Ints space on the return path. // This is safe because out is kept alive until the @@ -799,7 +799,7 @@ func callReflect(ctxt *makeFuncImpl, frame unsafe.Pointer, retValid *bool, regs panic("attempted to copy pointer to FP register") } offset := add(v.ptr, st.offset, "precomputed value offset") - memmove(unsafe.Pointer(®s.Floats[st.freg]), offset, st.size) + memmove(regs.FloatRegArgAddr(st.freg, st.size), offset, st.size) default: panic("unknown ABI part kind") }