In Perl_ck_subr(), hoist the if (proto) check outside of the while loop.