aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Verifier.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-25 21:23:19 +0000
committerChris Lattner <sabre@nondot.org>2009-04-25 21:23:19 +0000
commitcc864b0de7709ad1a286399697349fae6cb94a68 (patch)
treeee38733ad0a5bc78bba880056bc7630c8110636a /lib/VMCore/Verifier.cpp
parent72da57602b06716ebdac65b22d2506f03719e0a5 (diff)
downloadexternal_llvm-cc864b0de7709ad1a286399697349fae6cb94a68.zip
external_llvm-cc864b0de7709ad1a286399697349fae6cb94a68.tar.gz
external_llvm-cc864b0de7709ad1a286399697349fae6cb94a68.tar.bz2
Allow aliasee to be a GEP or bitcast instead of just a bitcast.
The real fix for this whole mess is to require the operand of the alias to be a *GlobalValue* (not a general constant, including constant exprs) but allow the operand and the alias type to be unrelated. This fixes PR4066 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r--lib/VMCore/Verifier.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index df9acee..5e1137f 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -427,7 +427,9 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) {
if (!isa<GlobalValue>(GA.getAliasee())) {
const ConstantExpr *CE = dyn_cast<ConstantExpr>(GA.getAliasee());
- Assert1(CE && CE->getOpcode() == Instruction::BitCast &&
+ Assert1(CE &&
+ (CE->getOpcode() == Instruction::BitCast ||
+ CE->getOpcode() == Instruction::GetElementPtr) &&
isa<GlobalValue>(CE->getOperand(0)),
"Aliasee should be either GlobalValue or bitcast of GlobalValue",
&GA);