projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b9cbf1
)
Do not allow a user to set the operand for a constant.
author
Tanya Lattner
<tonic@nondot.org>
Tue, 28 Oct 2008 17:22:40 +0000
(17:22 +0000)
committer
Tanya Lattner
<tonic@nondot.org>
Tue, 28 Oct 2008 17:22:40 +0000
(17:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58335
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/User.h
patch
|
blob
|
history
diff --git
a/include/llvm/User.h
b/include/llvm/User.h
index 570f381d1a8c4eb168e16f21305cfc3d0b0be78f..919693e082925582cd3e6a756a8cabf8fee1efff 100644
(file)
--- 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<Constant>((const Value*)this) ||
+ isa<GlobalValue>((const Value*)this)) &&
+ "Cannot mutate a constant with setOperand!");
OperandList[i] = Val;
}
unsigned getNumOperands() const { return NumOperands; }