From 3d6d2a63b2457450d93cfaa9787a27359264b2c3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 3 Aug 2015 17:54:50 +0000 Subject: =?UTF-8?q?re=20PR=20go/67101=20(mprof.goc:408:5:=20error:=20calli?= =?UTF-8?q?ng=20=E2=80=98=5F=5Fbuiltin=5Fframe=5Faddress=E2=80=99=20with?= =?UTF-8?q?=20a=20nonzero=20argument=20is=20unsafe=20[-Werror=3Dframe-addr?= =?UTF-8?q?ess])?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR go/67101 runtime: Remove call to __builtin_frame_address. __builtin_frame_address was only supposed to use nonzero arguments for debugging purposes. Calling it with nonzero arguments can have unpredictable results and uses are now marked unsafe when -Wframe-address is enabled. Reviewed-on: https://go-review.googlesource.com/13063 From-SVN: r226525 --- libgo/runtime/mprof.goc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libgo') diff --git a/libgo/runtime/mprof.goc b/libgo/runtime/mprof.goc index d9c220b..c9022df 100644 --- a/libgo/runtime/mprof.goc +++ b/libgo/runtime/mprof.goc @@ -402,10 +402,9 @@ func ThreadCreateProfile(p Slice) (n int, ok bool) { } func Stack(b Slice, all bool) (n int) { - byte *pc, *sp; + byte *pc; bool enablegc; - sp = runtime_getcallersp(&b); pc = (byte*)(uintptr)runtime_getcallerpc(&b); if(all) { @@ -423,7 +422,6 @@ func Stack(b Slice, all bool) (n int) { g->writebuf = (byte*)b.__values; g->writenbuf = b.__count; USED(pc); - USED(sp); runtime_goroutineheader(g); runtime_traceback(); runtime_printcreatedby(g); -- cgit v1.1