This patch teaches .verifyRoots to check if all roots are connected to the virtual root.
Diff Detail
Event Timeline
I was only able to make it fail by manually updating the tree; this doesn't catch the recent update error reported by @dmgreen. It just made me notice that we are missing this check.
This is actually quite annoying, because with postdominators there can be multiple correct tree and the checks that we currently have are not able to ensure that after the sequence we always arrive to the same tree. For now, the other patch (D43140) makes the verifier do the comparison with a fresh tree at the end.
Let me know if you know how to ensure the PDT is in canonical form after updates, I don't have any more ideas for it :(
Ah. Ok. Common forward dominators are not roots - of course they are not. That makes this harder.
After spending a day thinking about it, I have not come up with a sensible way to check this, that doesn't devolve into recalculating the tree (or worse). Especially as in this case we can't really trust the domtree to be "correct", with respects to the roots.
I was trying to come up with something where non-roots have non-virtual idoms or are reachable from 2+ roots. I'm not sure that can work though (or how slow it could be). I guess it may be simpler to just compare against a new tree, like we have already.