Check for validity of aliasee pointer before dereference.
authorAnton Korobeynikov <asl@math.spbu.ru>
Thu, 8 May 2008 23:11:06 +0000 (23:11 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Thu, 8 May 2008 23:11:06 +0000 (23:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50878 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index 75636d0bddad030477845129bd658f3e3bcdd1f2..aec5974209b9a18e96e7951b0cb8d88ec46452c6 100644 (file)
@@ -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 &&