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 {
|
if instr.IsAddr {
|
||||||
instr.X = renamed(renaming, alloc)
|
instr.X = renamed(renaming, alloc)
|
||||||
instr.IsAddr = false
|
instr.IsAddr = false
|
||||||
|
|
||||||
|
// Add DebugRef to instr.X's referrers.
|
||||||
|
if refs := instr.X.Referrers(); refs != nil {
|
||||||
|
*refs = append(*refs, instr)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// A source expression denotes the address
|
// A source expression denotes the address
|
||||||
// of an Alloc that was optimized away.
|
// of an Alloc that was optimized away.
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"code.google.com/p/go.tools/ssa/ssautil"
|
"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 {
|
func allPackages() []string {
|
||||||
var pkgs []string
|
var pkgs []string
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue