Check for validity of aliasee pointer before dereference.
llvm-svn: 50878
This commit is contained in:
parent
0360ecbec1
commit
a50eed4af9
|
@ -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 &&
|
||||
|
|
Loading…
Reference in New Issue