mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add an assert to detect an instruction being added as an operand of itself.
Swift SVN r16303
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user