From 4938d7b5fc06bbd137619eddd494a8cca288eb25 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 20 Apr 2016 17:29:50 -0700 Subject: [PATCH] cmd/compile: fix dominator check in check() 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 Reviewed-by: Josh Bleecher Snyder --- src/cmd/compile/internal/ssa/check.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/check.go b/src/cmd/compile/internal/ssa/check.go index e4b8cb05f4..f1d3857f88 100644 --- a/src/cmd/compile/internal/ssa/check.go +++ b/src/cmd/compile/internal/ssa/check.go @@ -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 }