mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: make Pciter more idiomatic
Rename it to PCIter and convert it to use methods. Set pcscale once, during construction, to make call sites clearer. Change some ints to bools. Use a simple iteration termination condition, instead of the cap comparison from the c2go translation. Instead of requiring a Pcdata, which requires one caller to synthesize a fake Pcdata, just ask for a byte slice. Passes toolstash-check. Change-Id: I811da0e929cf4a806bd6d70357ccf2911cd0c737 Reviewed-on: https://go-review.googlesource.com/c/go/+/171770 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
134ef176f0
commit
6d64dd731b
4 changed files with 53 additions and 47 deletions
|
|
@ -2112,9 +2112,9 @@ func stkcheck(ctxt *Link, up *chain, depth int) int {
|
|||
|
||||
endr := len(s.R)
|
||||
var ch1 chain
|
||||
var pcsp Pciter
|
||||
pcsp := newPCIter(ctxt)
|
||||
var r *sym.Reloc
|
||||
for pciterinit(ctxt, &pcsp, &s.FuncInfo.Pcsp); pcsp.done == 0; pciternext(&pcsp) {
|
||||
for pcsp.init(s.FuncInfo.Pcsp.P); !pcsp.done; pcsp.next() {
|
||||
// pcsp.value is in effect for [pcsp.pc, pcsp.nextpc).
|
||||
|
||||
// Check stack size in effect for this span.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue