• Austin Clements's avatar
    runtime: strongly encourage CallersFrames with the result of Callers · e4f73769
    Austin Clements authored
    For historical reasons, it's still commonplace to iterate over the
    slice returned by runtime.Callers and call FuncForPC on each PC. This
    is broken in gccgo and somewhat broken in gc and will become more
    broken in gc with mid-stack inlining.
    
    In Go 1.7, we introduced runtime.CallersFrames to deal with these
    problems, but didn't strongly direct people toward using it. Reword
    the documentation on runtime.Callers to more strongly encourage people
    to use CallersFrames and explicitly discourage them from iterating
    over the PCs or using FuncForPC on the results.
    
    Fixes #19426.
    
    Change-Id: Id0d14cb51a0e9521c8fdde9612610f2c2b9383c4
    Reviewed-on: https://go-review.googlesource.com/37726Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    e4f73769
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...