aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-04-28 14:35:41 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-04-28 14:35:41 +0000
commit0f53f7f2405e03a5ae5e684521567d7fe5a5d177 (patch)
tree351fdef1c5c2fa4dcb521ad4ed5f8ef9ca0cd4f2
parent3cb4ddaec04876035e3a1575c199335f9db1ddc2 (diff)
Let Verifier check aliasees
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36540 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Verifier.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 01eb860f91..c580e70d84 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -319,6 +319,13 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) {
Assert1(GA.getType() == GA.getAliasee()->getType(),
"Alias and aliasee types should match!", &GA);
+ if (!isa<GlobalValue>(GA.getAliasee())) {
+ const ConstantExpr *CE = dyn_cast<ConstantExpr>(GA.getAliasee());
+ Assert1(CE && CE->getOpcode() == Instruction::BitCast,
+ "Aliasee should be either GlobalValue or bitcast of GlobalValue",
+ &GA);
+ }
+
visitGlobalValue(GA);
}