[llvm-commits] [llvm] r50878 - /llvm/trunk/lib/VMCore/Verifier.cpp
Anton Korobeynikov
asl at math.spbu.ru
Thu May 8 16:11:07 PDT 2008
Author: asl
Date: Thu May 8 18:11:06 2008
New Revision: 50878
URL: http://llvm.org/viewvc/llvm-project?rev=50878&view=rev
Log:
Check for validity of aliasee pointer before dereference.
Modified:
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=50878&r1=50877&r2=50878&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Thu May 8 18:11:06 2008
@@ -367,9 +367,11 @@
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 &&
More information about the llvm-commits
mailing list