From 07bcc165475f3c34433ebf48b05f704fd40e5639 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 8 Sep 2016 09:49:31 -0700 Subject: [PATCH] runtime: simplify getargp Change-Id: I9ed62e8a6d8b9204c18748efd7845adabf3460b9 Reviewed-on: https://go-review.googlesource.com/28775 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Keith Randall Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/runtime/panic.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/runtime/panic.go b/src/runtime/panic.go index 60b277d52c..016e29013a 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -504,15 +504,9 @@ func gopanic(e interface{}) { // getargp returns the location where the caller // writes outgoing function call arguments. //go:nosplit +//go:noinline func getargp(x int) uintptr { // x is an argument mainly so that we can return its address. - // However, we need to make the function complex enough - // that it won't be inlined. We always pass x = 0, so this code - // does nothing other than keep the compiler from thinking - // the function is simple enough to inline. - if x > 0 { - return getcallersp(unsafe.Pointer(&x)) * 0 - } return uintptr(noescape(unsafe.Pointer(&x))) } -- 2.48.1