mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[IR] Don't accept null type in ConstantExpr::getGetElementPtr()
This is the same change as D105653, but for the constant expression version of the API.
This commit is contained in:
parent
dd3e030cca
commit
afb69b12ce
@ -2427,10 +2427,8 @@ Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C,
|
||||
Optional<unsigned> InRangeIndex,
|
||||
Type *OnlyIfReducedTy) {
|
||||
PointerType *OrigPtrTy = cast<PointerType>(C->getType()->getScalarType());
|
||||
if (!Ty)
|
||||
Ty = OrigPtrTy->getElementType();
|
||||
else
|
||||
assert(OrigPtrTy->isOpaqueOrPointeeTypeMatches(Ty));
|
||||
assert(Ty && "Must specify element type");
|
||||
assert(OrigPtrTy->isOpaqueOrPointeeTypeMatches(Ty));
|
||||
|
||||
if (Constant *FC =
|
||||
ConstantFoldGetElementPtr(Ty, C, InBounds, InRangeIndex, Idxs))
|
||||
|
Loading…
Reference in New Issue
Block a user