mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-12 23:37:33 +00:00
PR12357: The pointer was used before it was checked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153465 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
05fecbe42e
commit
c71108b6f8
@ -915,11 +915,13 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
||||
|
||||
// Handle gep(bitcast x) and gep(gep x, 0, 0, 0).
|
||||
Value *StrippedPtr = PtrOp->stripPointerCasts();
|
||||
PointerType *StrippedPtrTy = dyn_cast<PointerType>(StrippedPtr->getType());
|
||||
|
||||
// We do not handle pointer-vector geps here
|
||||
if (!StrippedPtr)
|
||||
return 0;
|
||||
|
||||
PointerType *StrippedPtrTy = dyn_cast<PointerType>(StrippedPtr->getType());
|
||||
|
||||
if (StrippedPtr != PtrOp &&
|
||||
StrippedPtrTy->getAddressSpace() == GEP.getPointerAddressSpace()) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user