mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Check that TD isn't NULL before dereferencing it down this path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187099 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2783,7 +2783,7 @@ bool Evaluator::EvaluateBlock(BasicBlock::iterator CurInst,
|
||||
Value *Ptr = PtrArg->stripPointerCasts();
|
||||
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
|
||||
Type *ElemTy = cast<PointerType>(GV->getType())->getElementType();
|
||||
if (!Size->isAllOnesValue() &&
|
||||
if (TD && !Size->isAllOnesValue() &&
|
||||
Size->getValue().getLimitedValue() >=
|
||||
TD->getTypeStoreSize(ElemTy)) {
|
||||
Invariants.insert(GV);
|
||||
|
Reference in New Issue
Block a user