This reverts commit b226c115e2.
Fixes #110005.
I have been working on a fix branch, but the problem was fairly
fundamental to the algorithm and the fix ended up being a rewrite
that I didn't quite finish yet, and I will be away next week. Since
the other bug is a crash rather than a change in behavior, better to
have the other bug than this one in the meantime.