This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
And add a test. Fixes issue #9202. Signed-off-by: Jeff Epler <jepler@gmail.com>