diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index 9022e914c92d..a4f2669de012 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/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(this) && !isa(this)) - assert((Ty->isFirstClassType() || Ty == Type::VoidTy) && + assert((Ty->isFirstClassType() || Ty == Type::VoidTy || + isa(ty)) && "Cannot create non-first-class values except for constants!"); }