Issue #22087:check for infinite recursion