mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add a sanity check for constant expression casts
llvm-svn: 8951
This commit is contained in:
parent
f090d28209
commit
bd123c6e51
@ -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