diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-05-08 23:11:06 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-05-08 23:11:06 +0000 |
commit | 018f77139892111d36ecf5580856dba4cc4b75d1 (patch) | |
tree | 3d690419e3f7bf4d5a1c19012da38df2cd21bb5a | |
parent | fd17f42bab8786850a9f8b2f84908b30598b160b (diff) | |
download | external_llvm-018f77139892111d36ecf5580856dba4cc4b75d1.zip external_llvm-018f77139892111d36ecf5580856dba4cc4b75d1.tar.gz external_llvm-018f77139892111d36ecf5580856dba4cc4b75d1.tar.bz2 |
Check for validity of aliasee pointer before dereference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50878 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Verifier.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 75636d0..aec5974 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -367,9 +367,11 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) { Assert1(GA.hasExternalLinkage() || GA.hasInternalLinkage() || GA.hasWeakLinkage(), "Alias should have external or external weak linkage!", &GA); + Assert1(GA.getAliasee(), + "Aliasee cannot be NULL!", &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 && |