From 424c56006dc52dfaa0dc7ba55c7a724ed39b6b78 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 10 Nov 2019 13:31:47 -0800 Subject: [PATCH] Add a paranoid assert to io_chain_t::append --- src/io.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/io.cpp b/src/io.cpp index 6bf0782b4..620c627ac 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -215,6 +215,7 @@ void io_chain_t::push_back(shared_ptr element) { } void io_chain_t::append(const io_chain_t &chain) { + assert(&chain != this && "Cannot append self to self"); this->insert(this->end(), chain.begin(), chain.end()); }