Fix the regressions my User changes introduced. Apparently some parts of
authorChris Lattner <sabre@nondot.org>
Mon, 31 Jan 2005 01:11:13 +0000 (01:11 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 31 Jan 2005 01:11:13 +0000 (01:11 +0000)
LLVM make the very reasonable assumption that constant expressions will
have at least one operand! :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19943 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Reader/Reader.cpp

index a36aa9950970f54f6bc52b7dc7dc87516237b779..cf68d678e2ca7f882bd4619b4cdee2398d08c6f5 100644 (file)
@@ -38,8 +38,11 @@ namespace {
     ConstantPlaceHolder();                       // DO NOT IMPLEMENT
     void operator=(const ConstantPlaceHolder &); // DO NOT IMPLEMENT
   public:
+    Use Op;
     ConstantPlaceHolder(const Type *Ty) 
-      : ConstantExpr(Ty, Instruction::UserOp1, 0, 0) {}
+      : ConstantExpr(Ty, Instruction::UserOp1, &Op, 1),
+        Op(UndefValue::get(Type::IntTy), this) {
+    }
   };
 }