summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-10-22 16:39:31 -0400
committerAustin Clements <austin@google.com>2014-10-22 16:39:31 -0400
commit097998292f184b893daa9775d4997b0eb3e7f567 (patch)
tree0f9aa62939ef4120ad6a9119cb12c8783012f77c
parentfc92f8a400cf3e4d053940e0b86b72d6de27d67a (diff)
downloadgo-097998292f184b893daa9775d4997b0eb3e7f567.tar.gz
[dev.power64] runtime: fix early GC of Defer objects
go_bootstrap was panicking during runtime initialization (under runtime.main) because Defer objects were being prematurely GC'd. This happened because of an incorrect change to runtime?unrollgcprog_m to make it endian-agnostic during the conversion of runtime bitmaps to byte arrays. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/161960044
-rw-r--r--src/runtime/mgc0.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/mgc0.c b/src/runtime/mgc0.c
index d376c1cf6..02f7eba12 100644
--- a/src/runtime/mgc0.c
+++ b/src/runtime/mgc0.c
@@ -1799,7 +1799,7 @@ runtime·unrollgcprog_m(void)
}
// atomic way to say mask[0] = 1
- x = typ->gc[0];
+ x = *(uintptr*)mask;
((byte*)&x)[0] = 1;
runtime·atomicstorep((void**)mask, (void*)x);
}