Skip to content
Unverified Commit 0cdacd5f authored by Nikita Popov's avatar Nikita Popov Committed by GitHub
Browse files

[DomTree] Fix root attachment in runDFS() (#73148)

Currently, runDFS() only sets the Parent of the DFS root if it is
already in the NodeToInfo map. This doesn't matter if we're running DFS
on the DT root, which doesn't have a parent anyway. However, when
running on PDT roots, this means we end up keeping the parent at 0,
rather than setting it to 1 for the virtual PDT root. Because the
virtual root (nullptr) has the same value as the dummy value in
NumToNode (nullptr) this happens to work out by accident right now.

I believe we should always be setting the parent in runDFS(), and adjust
AttachToNum in doFullDFSWalk() to be 1 (the virtual root) for PDTs.
parent b96bae28
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment