Revert r215611 because it caused the infinite loop in bug 20736. There is a reduced testcase in that bug.