mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
reflect: preserve ctxt across moveMakeFuncArgPtrs
In makeFuncStub and methodValueCall, it stores ctxt (DX) as an argument of moveMakeFuncArgPtrs, and assumes it does not change by the call. This is not guaranteed, and it does happen if -clobberdead compiler flag is used. Store it somewhere else and reload after the call. Change-Id: I9307e3cf94db4b38305ab35494088386dfcbaae8 Reviewed-on: https://go-review.googlesource.com/c/go/+/310409 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
b6e1c33603
commit
4fb74e0555
1 changed files with 6 additions and 0 deletions
|
|
@ -33,9 +33,12 @@ TEXT ·makeFuncStub<ABIInternal>(SB),(NOSPLIT|WRAPPER),$312
|
||||||
// frame is specially handled in the runtime. See the comment above LOCAL_RETVALID.
|
// frame is specially handled in the runtime. See the comment above LOCAL_RETVALID.
|
||||||
LEAQ LOCAL_REGARGS(SP), R12
|
LEAQ LOCAL_REGARGS(SP), R12
|
||||||
CALL runtime·spillArgs<ABIInternal>(SB)
|
CALL runtime·spillArgs<ABIInternal>(SB)
|
||||||
|
MOVQ DX, 24(SP) // outside of moveMakeFuncArgPtrs's arg area
|
||||||
MOVQ DX, 0(SP)
|
MOVQ DX, 0(SP)
|
||||||
MOVQ R12, 8(SP)
|
MOVQ R12, 8(SP)
|
||||||
CALL ·moveMakeFuncArgPtrs(SB)
|
CALL ·moveMakeFuncArgPtrs(SB)
|
||||||
|
MOVQ 24(SP), DX
|
||||||
|
MOVQ DX, 0(SP)
|
||||||
LEAQ argframe+0(FP), CX
|
LEAQ argframe+0(FP), CX
|
||||||
MOVQ CX, 8(SP)
|
MOVQ CX, 8(SP)
|
||||||
MOVB $0, LOCAL_RETVALID(SP)
|
MOVB $0, LOCAL_RETVALID(SP)
|
||||||
|
|
@ -61,9 +64,12 @@ TEXT ·methodValueCall<ABIInternal>(SB),(NOSPLIT|WRAPPER),$312
|
||||||
// frame is specially handled in the runtime. See the comment above LOCAL_RETVALID.
|
// frame is specially handled in the runtime. See the comment above LOCAL_RETVALID.
|
||||||
LEAQ LOCAL_REGARGS(SP), R12
|
LEAQ LOCAL_REGARGS(SP), R12
|
||||||
CALL runtime·spillArgs<ABIInternal>(SB)
|
CALL runtime·spillArgs<ABIInternal>(SB)
|
||||||
|
MOVQ DX, 24(SP) // outside of moveMakeFuncArgPtrs's arg area
|
||||||
MOVQ DX, 0(SP)
|
MOVQ DX, 0(SP)
|
||||||
MOVQ R12, 8(SP)
|
MOVQ R12, 8(SP)
|
||||||
CALL ·moveMakeFuncArgPtrs(SB)
|
CALL ·moveMakeFuncArgPtrs(SB)
|
||||||
|
MOVQ 24(SP), DX
|
||||||
|
MOVQ DX, 0(SP)
|
||||||
LEAQ argframe+0(FP), CX
|
LEAQ argframe+0(FP), CX
|
||||||
MOVQ CX, 8(SP)
|
MOVQ CX, 8(SP)
|
||||||
MOVB $0, LOCAL_RETVALID(SP)
|
MOVB $0, LOCAL_RETVALID(SP)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue