From: Gurusamy Sarathy Date: Tue, 6 Jun 2000 00:42:59 +0000 (+0000) Subject: Perl_eval_pv() leaks 4 bytes every time it is called because it X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f807eda9ff3570fa55edf97b589a9c028d9c5bb8;p=p5sagit%2Fp5-mst-13.2.git Perl_eval_pv() leaks 4 bytes every time it is called because it does a PUSHMARK that's never ever POPMARKed; in general, only Perl_call_[sp]v() need a PUSHMARK for incoming arguments; Perl_eval_[sp]v() don't because they don't take any incoming arguments (this leak has been around since the original version of perl_eval_pv() in 5.003_97e) p4raw-id: //depot/perl@6201 --- diff --git a/perl.c b/perl.c index 801dbe1..ade1d3c 100644 --- a/perl.c +++ b/perl.c @@ -1784,9 +1784,9 @@ S_call_body(pTHX_ OP *myop, int is_eval) if (PL_op == myop) { if (is_eval) - PL_op = Perl_pp_entereval(aTHX); + PL_op = Perl_pp_entereval(aTHX); /* this doesn't do a POPMARK */ else - PL_op = Perl_pp_entersub(aTHX); + PL_op = Perl_pp_entersub(aTHX); /* this does */ } if (PL_op) CALLRUNOPS(aTHX); @@ -1908,7 +1908,6 @@ Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error) dSP; SV* sv = newSVpv(p, 0); - PUSHMARK(SP); eval_sv(sv, G_SCALAR); SvREFCNT_dec(sv);