]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix dominator check in check()
authorKeith Randall <khr@golang.org>
Thu, 21 Apr 2016 00:29:50 +0000 (17:29 -0700)
committerKeith Randall <khr@golang.org>
Thu, 21 Apr 2016 02:53:53 +0000 (02:53 +0000)
Ancestor comparison was the wrong way around, effectively
disabling the def-must-dominate-use check.

Update #15084

Change-Id: Ic56d674c5000569d2cc855bbb000a60eae517c7c
Reviewed-on: https://go-review.googlesource.com/22330
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/ssa/check.go

index e4b8cb05f4281aece1b8fc98e8d8c56abdfbdc55..f1d3857f881892977febcfa08bd7e30dbff71886 100644 (file)
@@ -338,7 +338,7 @@ func checkFunc(f *Func) {
 
 // domCheck reports whether x dominates y (including x==y).
 func domCheck(f *Func, sdom sparseTree, x, y *Block) bool {
-       if !sdom.isAncestorEq(y, f.Entry) {
+       if !sdom.isAncestorEq(f.Entry, y) {
                // unreachable - ignore
                return true
        }