aboutsummaryrefslogtreecommitdiff
path: root/test/inline_caller.go
diff options
context:
space:
mode:
authorKeith Randall <keithr@alum.mit.edu>2019-01-05 14:31:23 -0800
committerKeith Randall <khr@golang.org>2019-01-08 21:54:04 +0000
commit956879dd0bf31b26d2425c2eadbeb19b90812187 (patch)
tree7d4bb468334d274917f03a783d7d3441e7478c1e /test/inline_caller.go
parent033b6501817aefebc6fc56b6212ff6abf14c8127 (diff)
downloadgo-956879dd0bf31b26d2425c2eadbeb19b90812187.tar.gz
go-956879dd0bf31b26d2425c2eadbeb19b90812187.zip
runtime: make FuncForPC return the innermost inlined frame
Returning the innermost frame instead of the outermost makes code that walks the results of runtime.Caller{,s} still work correctly in the presence of mid-stack inlining. Fixes #29582 Change-Id: I2392e3dd5636eb8c6f58620a61cef2194fe660a7 Reviewed-on: https://go-review.googlesource.com/c/156364 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'test/inline_caller.go')
-rw-r--r--test/inline_caller.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/inline_caller.go b/test/inline_caller.go
index 79039a6bb5..daff145a92 100644
--- a/test/inline_caller.go
+++ b/test/inline_caller.go
@@ -54,9 +54,9 @@ type wantFrame struct {
// -1 means don't care
var expected = []wantFrame{
- 0: {"main.testCaller", 36},
- 1: {"main.testCaller", 31},
- 2: {"main.testCaller", 27},
+ 0: {"main.h", 36},
+ 1: {"main.g", 31},
+ 2: {"main.f", 27},
3: {"main.testCaller", 42},
4: {"main.main", 68},
5: {"runtime.main", -1},