From: Rob Pike Date: Wed, 18 Nov 2009 23:00:02 +0000 (-0800) Subject: bugs in memmove: X-Git-Tag: weekly.2009-12-07~211 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=093493c6a54458e79ddc1d18441a427747d1fafa;p=gostls13.git bugs in memmove: - has arguments (no stack split) - MOVL does not set condition R=ken2, rsc https://golang.org/cl/156086 --- diff --git a/src/pkg/runtime/386/memmove.s b/src/pkg/runtime/386/memmove.s index 4862456218..8adb687c52 100644 --- a/src/pkg/runtime/386/memmove.s +++ b/src/pkg/runtime/386/memmove.s @@ -23,11 +23,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - TEXT memmove(SB), $0 + TEXT memmove(SB), 7, $0 MOVL to+0(FP), DI MOVL fr+4(FP), SI MOVL n+8(FP), BX + CMPL BX, $0 JLT fault /* @@ -38,7 +39,7 @@ JLS back /* - * foreward copy loop + * forward copy loop */ MOVL BX, CX SHRL $2, CX diff --git a/src/pkg/runtime/amd64/memmove.s b/src/pkg/runtime/amd64/memmove.s index e0a03d6def..d755580dc5 100644 --- a/src/pkg/runtime/amd64/memmove.s +++ b/src/pkg/runtime/amd64/memmove.s @@ -23,11 +23,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - TEXT memmove(SB), $0 + TEXT memmove(SB), 7, $0 MOVQ to+0(FP), DI MOVQ fr+8(FP), SI MOVLQSX n+16(FP), BX + CMPQ BX, $0 JLT fault /* @@ -38,7 +39,7 @@ JLS back /* - * foreward copy loop + * forward copy loop */ MOVQ BX, CX SHRQ $3, CX diff --git a/src/pkg/runtime/arm/memmove.s b/src/pkg/runtime/arm/memmove.s index 38cccc769a..bf172680c1 100644 --- a/src/pkg/runtime/arm/memmove.s +++ b/src/pkg/runtime/arm/memmove.s @@ -30,8 +30,7 @@ N = 3 TMP = 3 /* N and TMP don't overlap */ TMP1 = 4 -TEXT memcpy(SB), $0 -TEXT memmove(SB), $-4 +TEXT memmove(SB), 7, $-4 _memmove: MOVW R(TS), to+0(FP) /* need to save for return value */ MOVW from+4(FP), R(FROM)