mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-05 12:31:46 +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() ||
|
Assert1(GA.hasExternalLinkage() || GA.hasInternalLinkage() ||
|
||||||
GA.hasWeakLinkage(),
|
GA.hasWeakLinkage(),
|
||||||
"Alias should have external or external weak linkage!", &GA);
|
"Alias should have external or external weak linkage!", &GA);
|
||||||
|
Assert1(GA.getAliasee(),
|
||||||
|
"Aliasee cannot be NULL!", &GA);
|
||||||
Assert1(GA.getType() == GA.getAliasee()->getType(),
|
Assert1(GA.getType() == GA.getAliasee()->getType(),
|
||||||
"Alias and aliasee types should match!", &GA);
|
"Alias and aliasee types should match!", &GA);
|
||||||
|
|
||||||
if (!isa<GlobalValue>(GA.getAliasee())) {
|
if (!isa<GlobalValue>(GA.getAliasee())) {
|
||||||
const ConstantExpr *CE = dyn_cast<ConstantExpr>(GA.getAliasee());
|
const ConstantExpr *CE = dyn_cast<ConstantExpr>(GA.getAliasee());
|
||||||
Assert1(CE && CE->getOpcode() == Instruction::BitCast &&
|
Assert1(CE && CE->getOpcode() == Instruction::BitCast &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user