diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IR/Constants.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/IR/Constants.cpp b/lib/IR/Constants.cpp index 9327554..e984aac 100644 --- a/lib/IR/Constants.cpp +++ b/lib/IR/Constants.cpp @@ -1465,10 +1465,11 @@ Constant *ConstantExpr::getTruncOrBitCast(Constant *C, Type *Ty) { } Constant *ConstantExpr::getPointerCast(Constant *S, Type *Ty) { - assert(S->getType()->isPointerTy() && "Invalid cast"); - assert((Ty->isIntegerTy() || Ty->isPointerTy()) && "Invalid cast"); + assert(S->getType()->isPtrOrPtrVectorTy() && "Invalid cast"); + assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) && + "Invalid cast"); - if (Ty->isIntegerTy()) + if (Ty->isIntOrIntVectorTy()) return getPtrToInt(S, Ty); return getBitCast(S, Ty); } |