From: Nicholas Clark Date: Fri, 16 Mar 2007 19:29:04 +0000 (+0000) Subject: Under -Dmad, free the ops representing the dead code when a branch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=22f5163f10c4a1f42ac0d46e22d5f1e42e085536;p=p5sagit%2Fp5-mst-13.2.git Under -Dmad, free the ops representing the dead code when a branch conditional value is actually a constant. Previously this was leaking ops, and more visibly shared hash keys. p4raw-id: //depot/perl@30605 --- diff --git a/op.c b/op.c index 7c649fc..981b765 100644 --- a/op.c +++ b/op.c @@ -4246,12 +4246,12 @@ Perl_newCONDOP(pTHX_ I32 flags, OP *first, OP *trueop, OP *falseop) trueop = newUNOP(OP_NULL, 0, trueop); op_getmad(first,trueop,'C'); op_getmad(falseop,trueop,'e'); - } - /* FIXME for MAD - should there be an ELSE here? */ -#else - op_free(first); - op_free(falseop); + } else #endif + { + op_free(first); + op_free(falseop); + } return trueop; } else { @@ -4260,12 +4260,12 @@ Perl_newCONDOP(pTHX_ I32 flags, OP *first, OP *trueop, OP *falseop) falseop = newUNOP(OP_NULL, 0, falseop); op_getmad(first,falseop,'C'); op_getmad(trueop,falseop,'t'); - } - /* FIXME for MAD - should there be an ELSE here? */ -#else - op_free(first); - op_free(trueop); + } else #endif + { + op_free(first); + op_free(trueop); + } return falseop; } }