diff options
author | Russ Cox <rsc@golang.org> | 2014-08-25 14:38:19 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-08-25 14:38:19 -0400 |
commit | 588ffed86c777b6270c341fffadbbfb82f2c6a9c (patch) | |
tree | 4e5302f4267cc27b1bc1e04c5c4469f577f0ec0d /src/cmd/8g | |
parent | e4b65ea6a0b2755b284d20e1822ea2db8df9a7e6 (diff) | |
download | go-588ffed86c777b6270c341fffadbbfb82f2c6a9c.tar.gz |
cmd/gc, runtime: treat slices and strings like pointers in garbage collection
Before, a slice with cap=0 or a string with len=0 might have its
base pointer pointing beyond the actual slice/string data into
the next block. The collector had to ignore slices and strings with
cap=0 in order to avoid misinterpreting the base pointer.
Now, a slice with cap=0 or a string with len=0 still has a base
pointer pointing into the actual slice/string data, no matter what.
The collector can now always scan the pointer, which means
strings and slices are no longer special.
Fixes issue 8404.
LGTM=khr, josharian
R=josharian, khr, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/112570044
Diffstat (limited to 'src/cmd/8g')
-rw-r--r-- | src/cmd/8g/cgen.c | 1 | ||||
-rw-r--r-- | src/cmd/8g/gsubr.c | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/src/cmd/8g/cgen.c b/src/cmd/8g/cgen.c index bdf728dbb..f3093bc26 100644 --- a/src/cmd/8g/cgen.c +++ b/src/cmd/8g/cgen.c @@ -242,7 +242,6 @@ cgen(Node *n, Node *res) case OOR: case OXOR: case OADD: - case OADDPTR: case OMUL: a = optoas(n->op, nl->type); if(a == AIMULB) { diff --git a/src/cmd/8g/gsubr.c b/src/cmd/8g/gsubr.c index 66d5b8d69..9ee418cb7 100644 --- a/src/cmd/8g/gsubr.c +++ b/src/cmd/8g/gsubr.c @@ -430,7 +430,6 @@ optoas(int op, Type *t) case CASE(OADD, TINT32): case CASE(OADD, TUINT32): case CASE(OADD, TPTR32): - case CASE(OADDPTR, TPTR32): a = AADDL; break; |