aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/Value.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 9022e914c9..a4f2669de0 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -32,7 +32,8 @@ static inline const Type *checkType(const Type *Ty) {
Value::Value(const Type *ty, unsigned scid, const std::string &name)
: SubclassID(scid), Ty(checkType(ty)), Name(name) {
if (!isa<Constant>(this) && !isa<BasicBlock>(this))
- assert((Ty->isFirstClassType() || Ty == Type::VoidTy) &&
+ assert((Ty->isFirstClassType() || Ty == Type::VoidTy ||
+ isa<OpaqueType>(ty)) &&
"Cannot create non-first-class values except for constants!");
}