diff options
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index 01eb860f911..c580e70d84e 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/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); } |

