Add an assert to detect an instruction being added as an operand of itself.

Swift SVN r16303
This commit is contained in:
Mark Lacey
2014-04-14 05:40:31 +00:00
parent 6e5ca8a91f
commit 6ac1e51370

View File

@@ -280,6 +280,9 @@ public:
// It's probably not worth optimizing for the case of switching
// operands on a single value.
removeFromCurrent();
assert(cast<ValueBase>(Owner) != newValue.getDef()
&& "Cannot add a value as an operand of the instruction that defines"
" it!");
TheValue = newValue;
insertIntoCurrent();
}