mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
PR12357: The pointer was used before it was checked.
llvm-svn: 153465
This commit is contained in:
parent
a7e2266fa7
commit
165c8a3432
@ -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…
Reference in New Issue
Block a user