]> Cypherpunks repositories - gostls13.git/commit
runtime: use 4 byte writes in amd64p32 memmove/memclr
authorAustin Clements <austin@google.com>
Fri, 2 Oct 2015 22:17:54 +0000 (18:17 -0400)
committerAustin Clements <austin@google.com>
Fri, 2 Oct 2015 22:49:15 +0000 (22:49 +0000)
commit9f6df6c9407eb9a7f2393d00d7442f414a4d7dfa
treece535df3a9caf762a9dec0d4829c05f323d8ebe7
parent44078a32288ee8890882cb1578160715324407ff
runtime: use 4 byte writes in amd64p32 memmove/memclr

Currently, amd64p32's memmove and memclr use 8 byte writes as much as
possible and 1 byte writes for the tail of the object. However, if an
object ends with a 4 byte pointer at an 8 byte aligned offset, this
may copy/zero the pointer field one byte at a time, allowing the
garbage collector to observe a partially copied pointer.

Fix this by using 4 byte writes instead of 8 byte writes.

Updates #12552.

Change-Id: I13324fd05756fb25ae57e812e836f0a975b5595c
Reviewed-on: https://go-review.googlesource.com/15370
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/asm_amd64p32.s
src/runtime/memmove_nacl_amd64p32.s