From: Nicholas Clark Date: Sun, 5 Feb 2006 18:51:17 +0000 (+0000) Subject: Eliminate a croak we can't get to. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ab4416c0cc78ec16a7fc677ba53fd489f75074dc;p=p5sagit%2Fp5-mst-13.2.git Eliminate a croak we can't get to. p4raw-id: //depot/perl@27090 --- diff --git a/sv.c b/sv.c index 752dff0..f667c93 100644 --- a/sv.c +++ b/sv.c @@ -1154,9 +1154,10 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 new_type) SvFLAGS(sv) &= ~SVTYPEMASK; SvFLAGS(sv) |= new_type; + /* This can't happen, as SVt_NULL is <= all values of new_type, so one of + the return statements above will have triggered. */ + assert (new_type != SVt_NULL); switch (new_type) { - case SVt_NULL: - Perl_croak(aTHX_ "Can't upgrade to undef"); case SVt_IV: assert(old_type == SVt_NULL); SvANY(sv) = (XPVIV*)((char*)&(sv->sv_u.svu_iv) - STRUCT_OFFSET(XPVIV, xiv_iv));