aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Value.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 3429d7c3b3..0ac7205104 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -18,8 +18,13 @@
// Value Class
//===----------------------------------------------------------------------===//
+static inline const Type *checkType(const Type *Ty) {
+ assert(Ty && "Value defined with a null type: Error!");
+ return Ty;
+}
+
Value::Value(const Type *ty, ValueTy vty, const string &name = "")
- : Name(name), Ty(ty, this) {
+ : Name(name), Ty(checkType(ty), this) {
VTy = vty;
}