mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
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
This commit is contained in:
parent
fd17f42bab
commit
018f771398
@ -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…
x
Reference in New Issue
Block a user