aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/ilist.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/ilist.h')
-rw-r--r--include/llvm/ADT/ilist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h
index 7f5cd17..36650d4 100644
--- a/include/llvm/ADT/ilist.h
+++ b/include/llvm/ADT/ilist.h
@@ -472,6 +472,10 @@ private:
//
void transfer(iterator position, iplist &L2, iterator first, iterator last) {
assert(first != last && "Should be checked by callers");
+ // Position cannot be contained in the range to be transferred.
+ // Check for the most common mistake.
+ assert(position != first &&
+ "Insertion point can't be one of the transferred nodes");
if (position != last) {
// Note: we have to be careful about the case when we move the first node