1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Do not allow a user to set the operand for a constant.

llvm-svn: 58335
This commit is contained in:
Tanya Lattner 2008-10-28 17:22:40 +00:00
parent 12f71cb784
commit 7bd0aec942

View File

@ -95,6 +95,9 @@ public:
}
void setOperand(unsigned i, Value *Val) {
assert(i < NumOperands && "setOperand() out of range!");
assert((!isa<Constant>((const Value*)this) ||
isa<GlobalValue>((const Value*)this)) &&
"Cannot mutate a constant with setOperand!");
OperandList[i] = Val;
}
unsigned getNumOperands() const { return NumOperands; }