Assert that region is not cloned into itself.

PiperOrigin-RevId: 273707291
This commit is contained in:
Christian Sigg 2019-10-09 02:43:18 -07:00 committed by A. Unique TensorFlower
parent 395ce4b41b
commit 7c67ec0f03

View File

@ -78,6 +78,7 @@ void Region::cloneInto(Region *dest, BlockAndValueMapping &mapper) {
void Region::cloneInto(Region *dest, Region::iterator destPos, void Region::cloneInto(Region *dest, Region::iterator destPos,
BlockAndValueMapping &mapper) { BlockAndValueMapping &mapper) {
assert(dest && "expected valid region to clone into"); assert(dest && "expected valid region to clone into");
assert(this != dest && "cannot clone region into itself");
// If the list is empty there is nothing to clone. // If the list is empty there is nothing to clone.
if (empty()) if (empty())