diff options
author | Tianon Gravi <admwiggin@gmail.com> | 2014-11-25 23:46:26 -0700 |
---|---|---|
committer | Tianon Gravi <admwiggin@gmail.com> | 2014-11-25 23:46:26 -0700 |
commit | 8d8329ed5dfb9622c82a9fbec6fd99a580f9c9f6 (patch) | |
tree | c4c86e525346536900b0e51a90f4d9a0db1ee895 /src/pkg/runtime | |
parent | f4fa1ef6e6ccd9264db61c6400528158e5913bda (diff) | |
download | golang-8d8329ed5dfb9622c82a9fbec6fd99a580f9c9f6.tar.gz |
Imported Upstream version 1.3.3upstream/1.3.3
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r-- | src/pkg/runtime/asm_amd64.s | 3 | ||||
-rw-r--r-- | src/pkg/runtime/runtime.c | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/pkg/runtime/asm_amd64.s b/src/pkg/runtime/asm_amd64.s index 3c7eaf343..2e2886609 100644 --- a/src/pkg/runtime/asm_amd64.s +++ b/src/pkg/runtime/asm_amd64.s @@ -784,7 +784,8 @@ havem: MOVQ BP, -8(DI) LEAQ -(8+8)(DI), SP MOVQ R8, 0(SP) - CALL runtime·cgocallbackg(SB) + MOVQ $runtime·cgocallbackg(SB), AX // hide function call from linker + CALL AX MOVQ 0(SP), R8 // Restore g->sched (== m->curg->sched) from saved values. diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c index 3a4f7199e..3b322e0de 100644 --- a/src/pkg/runtime/runtime.c +++ b/src/pkg/runtime/runtime.c @@ -138,8 +138,6 @@ runtime·goenvs_unix(void) syscall·envs.array = (byte*)s; syscall·envs.len = n; syscall·envs.cap = n; - - traceback_cache = ~(uint32)0; } int32 @@ -343,6 +341,16 @@ runtime·parsedebugvars(void) { byte *p; intgo i, n; + bool tmp; + + // gotraceback caches the GOTRACEBACK setting in traceback_cache. + // gotraceback can be called before the environment is available. + // traceback_cache must be reset after the environment is made + // available, in order for the environment variable to take effect. + // The code is fixed differently in Go 1.4. + // This is a limited fix for Go 1.3.3. + traceback_cache = ~(uint32)0; + runtime·gotraceback(&tmp); p = runtime·getenv("GODEBUG"); if(p == nil) |