Skip to content

Commit 7eef2e7

Browse files
author
Joel Dice
committed
fix GC safety bug in cloneTreeNode
1 parent 33b3239 commit 7eef2e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/util.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ setTreeNodeRed(Thread*, object n, bool red)
5050
inline object
5151
cloneTreeNode(Thread* t, object n)
5252
{
53+
PROTECT(t, n);
54+
5355
object newNode = makeTreeNode
5456
(t, getTreeNodeValue(t, n), treeNodeLeft(t, n), treeNodeRight(t, n));
5557
setTreeNodeRed(t, newNode, treeNodeRed(t, n));

0 commit comments

Comments
 (0)