mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
fix GC safety bugs in leftRotate and rightRotate
This commit is contained in:
parent
7eef2e7918
commit
31e5e4c286
@ -104,6 +104,8 @@ treeFind(Thread* t, object old, object node, object sentinal,
|
||||
object
|
||||
leftRotate(Thread* t, object n)
|
||||
{
|
||||
PROTECT(t, n);
|
||||
|
||||
object child = cloneTreeNode(t, treeNodeRight(t, n));
|
||||
set(t, n, TreeNodeRight, treeNodeLeft(t, child));
|
||||
set(t, child, TreeNodeLeft, n);
|
||||
@ -113,6 +115,8 @@ leftRotate(Thread* t, object n)
|
||||
object
|
||||
rightRotate(Thread* t, object n)
|
||||
{
|
||||
PROTECT(t, n);
|
||||
|
||||
object child = cloneTreeNode(t, treeNodeLeft(t, n));
|
||||
set(t, n, TreeNodeLeft, treeNodeRight(t, child));
|
||||
set(t, child, TreeNodeRight, n);
|
||||
|
Loading…
Reference in New Issue
Block a user