Fix PR361.
authorChris Lattner <sabre@nondot.org>
Mon, 7 Jun 2004 23:07:33 +0000 (23:07 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 7 Jun 2004 23:07:33 +0000 (23:07 +0000)
Dominance properties don't hold in unreachable code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14053 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index 3bfa5b4df091548183e6205f6e072ffc1ddc2325..ef76dff0baf8fbf6fd99928a23cfb0a682b0af7b 100644 (file)
@@ -592,7 +592,8 @@ void Verifier::visitInstruction(Instruction &I) {
         else if (OpBlock == BB) {
           // If they are in the same basic block, make sure that the definition
           // comes before the use.
-          Assert2(DS->dominates(Op, &I),
+          Assert2(DS->dominates(Op, &I) ||
+                  !DS->dominates(&BB->getParent()->getEntryBlock(), BB),
                   "Instruction does not dominate all uses!", Op, &I);
         }