From 7d72d5abd7ba371db8e1539e69614329e24cdfa5 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Thu, 6 Feb 2020 14:15:14 +0100 Subject: [PATCH] [poincare/tree_handle] Assert B is not an ancestor of A in replaceWithInPlace(A, B) --- poincare/src/tree_handle.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/poincare/src/tree_handle.cpp b/poincare/src/tree_handle.cpp index bc7429e61..3e87d6f7a 100644 --- a/poincare/src/tree_handle.cpp +++ b/poincare/src/tree_handle.cpp @@ -62,6 +62,7 @@ void TreeHandle::replaceChildInPlace(TreeHandle oldChild, TreeHandle newChild) { if (oldChild == newChild) { return; } + assert(!oldChild.hasAncestor(newChild, true)); assert(!isUninitialized());