Apply D28224: 'Throw exception after too many steps' Fixes PR#20291. Thanks to Tim Shen for the patch

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313056 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed