mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Add a sanity check for constant expression casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8951 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fcc54b3ede
commit
9eacf8aac8
@ -897,6 +897,8 @@ struct ConvertConstantType<ConstantExpr, Type> {
|
||||
static ValueMap<ExprMapKeyType, Type, ConstantExpr> ExprConstants;
|
||||
|
||||
Constant *ConstantExpr::getCast(Constant *C, const Type *Ty) {
|
||||
assert(Ty->isFirstClassType() && "Cannot cast to an aggregate type!");
|
||||
|
||||
if (Constant *FC = ConstantFoldCastInstruction(C, Ty))
|
||||
return FC; // Fold a few common cases...
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user