From: Tanya Lattner Date: Tue, 28 Oct 2008 17:22:40 +0000 (+0000) Subject: Do not allow a user to set the operand for a constant. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=803f5fc02f73651fecc342807939066b067b65b5;p=oota-llvm.git Do not allow a user to set the operand for a constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58335 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/User.h b/include/llvm/User.h index 570f381d1a8..919693e0829 100644 --- a/include/llvm/User.h +++ b/include/llvm/User.h @@ -95,6 +95,9 @@ public: } void setOperand(unsigned i, Value *Val) { assert(i < NumOperands && "setOperand() out of range!"); + assert((!isa((const Value*)this) || + isa((const Value*)this)) && + "Cannot mutate a constant with setOperand!"); OperandList[i] = Val; } unsigned getNumOperands() const { return NumOperands; }