go.tools/ssa: fix bug: lifting pass invalidated Referrers info for DebugRef's X operand.
Tested: by enabling debug info globally in stdlib_test, the existing sanity checks catch it. R=gri CC=golang-codereviews https://golang.org/cl/50570043
This commit is contained in:
parent
3d82e7e94a
commit
d2fe54b33c
|
|
@ -523,6 +523,11 @@ func rename(u *BasicBlock, renaming []Value, newPhis newPhiMap) {
|
|||
if instr.IsAddr {
|
||||
instr.X = renamed(renaming, alloc)
|
||||
instr.IsAddr = false
|
||||
|
||||
// Add DebugRef to instr.X's referrers.
|
||||
if refs := instr.X.Referrers(); refs != nil {
|
||||
*refs = append(*refs, instr)
|
||||
}
|
||||
} else {
|
||||
// A source expression denotes the address
|
||||
// of an Alloc that was optimized away.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import (
|
|||
"code.google.com/p/go.tools/ssa/ssautil"
|
||||
)
|
||||
|
||||
const debugMode = false
|
||||
const debugMode = true // cost: +30% space, +18% time for SSA building
|
||||
|
||||
func allPackages() []string {
|
||||
var pkgs []string
|
||||
|
|
|
|||
Loading…
Reference in New Issue