From 5063056bd19698a92da3fd69c34ee784af62b03e Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 16 Aug 2022 13:04:16 -0400 Subject: [PATCH] runtime: drop redundant argument to getArgInfo The f funcInfo argument is always the same as frame.fn, so we don't need to pass it. I suspect that was there to make the signatures of getArgInfoFast and getArgInfo more similar, but it's not necessary. For #54466. Change-Id: Idc717f4df09e97cad49d52c5b7edf28090908cba Reviewed-on: https://go-review.googlesource.com/c/go/+/424255 Run-TryBot: Austin Clements Auto-Submit: Austin Clements Reviewed-by: Michael Pratt Reviewed-by: Cherry Mui TryBot-Result: Gopher Robot --- src/runtime/traceback.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 27ac7b0977..ed64343470 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -294,7 +294,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in var ok bool frame.arglen, frame.argmap, ok = getArgInfoFast(f, callback != nil) if !ok { - frame.arglen, frame.argmap = getArgInfo(&frame, f, callback != nil) + frame.arglen, frame.argmap = getArgInfo(&frame, callback != nil) } } @@ -679,7 +679,8 @@ func getArgInfoFast(f funcInfo, needArgMap bool) (arglen uintptr, argmap *bitvec // getArgInfo returns the argument frame information for a call to f // with call frame frame. -func getArgInfo(frame *stkframe, f funcInfo, needArgMap bool) (arglen uintptr, argmap *bitvector) { +func getArgInfo(frame *stkframe, needArgMap bool) (arglen uintptr, argmap *bitvector) { + f := frame.fn arglen = uintptr(f.args) if needArgMap && f.args == _ArgsSizeUnknown { // Extract argument bitmaps for reflect stubs from the calls they made to reflect.