Skip to content

Commit bc53fa6

Browse files
committed
Never collapse root nodes on hierarchy.
1 parent bbacd07 commit bc53fa6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

codepulse/src/main/scala/com/secdec/codepulse/data/bytecode/CodeTree2.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ trait CodeTreeNode {
7878
childrenCondensed foreach { _.parent = None }
7979

8080
childrenCondensed match {
81-
case child :: Nil if child.kind == this.kind =>
81+
case child :: Nil if child.kind == this.kind && parent.isDefined =>
8282
// just return that child, and this node is effectively removed
83+
// (only do this when there is a parent. if no parent, don't collapse this node away)
8384
child
8485
case list =>
8586
// Note: children is a Set, so if the list suddenly has duplicates, some nodes will be lost.

0 commit comments

Comments
 (0)