From: Nicholas Clark Date: Sat, 11 Feb 2006 00:40:04 +0000 (+0000) Subject: assert() that we can't reach two unreachable code paths X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c2b4a044213bea86e9e2d063d8cade83f2b9aa8b;p=p5sagit%2Fp5-mst-13.2.git assert() that we can't reach two unreachable code paths (in Perl_magic_get and Perl_pp_shift). p4raw-id: //depot/perl@27154 --- diff --git a/mg.c b/mg.c index 6446b2c..339a6d4 100644 --- a/mg.c +++ b/mg.c @@ -843,8 +843,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) { i = t1 - s1; s = rx->subbeg + s1; - if (!rx->subbeg) - break; + assert(rx->subbeg); getrx: if (i >= 0) { diff --git a/pp.c b/pp.c index d5c2679..3aaad3b 100644 --- a/pp.c +++ b/pp.c @@ -4166,8 +4166,7 @@ PP(pp_shift) AV * const av = (AV*)POPs; SV * const sv = PL_op->op_type == OP_SHIFT ? av_shift(av) : av_pop(av); EXTEND(SP, 1); - if (!sv) - RETPUSHUNDEF; + assert (sv); if (AvREAL(av)) (void)sv_2mortal(sv); PUSHs(sv);