1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:20:22 -07:00

bugs in memmove:

- has arguments (no stack split)
	- MOVL does not set condition

R=ken2, rsc
https://golang.org/cl/156086
This commit is contained in:
Rob Pike 2009-11-18 15:00:02 -08:00
parent 9be56adf3c
commit 093493c6a5
3 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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)