projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fcc54b3
)
Add a sanity check for constant expression casts
author
Chris Lattner
<sabre@nondot.org>
Tue, 7 Oct 2003 22:19:19 +0000
(22:19 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 7 Oct 2003 22:19:19 +0000
(22:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8951
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/Constants.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/Constants.cpp
b/lib/VMCore/Constants.cpp
index 3e481fd0481e236b1b8e9ecd7db32f3dcae5779d..4e1d905fecbf0f73bc9a48634b09def5d9f1e85d 100644
(file)
--- a/
lib/VMCore/Constants.cpp
+++ b/
lib/VMCore/Constants.cpp
@@
-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...