]> Cypherpunks repositories - gostls13.git/commit
cmd/8g: Make clearfat non-interleaved with pointer calculations.
authorDaniel Morsing <daniel.morsing@gmail.com>
Wed, 17 Jul 2013 09:04:34 +0000 (11:04 +0200)
committerDaniel Morsing <daniel.morsing@gmail.com>
Wed, 17 Jul 2013 09:04:34 +0000 (11:04 +0200)
commit85a7c090c4f831b6d29556c36bbe0a6cd8e8da6d
tree88da25c9660f8fe5ec5b9cf89eb7f95253b67933
parentdeee03f17eee3bf8c8d6a607d413b8141c0f0714
cmd/8g: Make clearfat non-interleaved with pointer calculations.

clearfat (used to zero initialize structures) will use AX for x86 block ops. If we write to AX while calculating the dest pointer, we will fill the structure with incorrect values.
Since 64-bit arithmetic uses AX to synthesize a 64-bit register, getting an adress by indexing with 64-bit ops can clobber the register.

Fixes #5820.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11383043
src/cmd/8g/ggen.c
test/fixedbugs/issue5820.go [new file with mode: 0644]