Change 33138 by [EMAIL PROTECTED] on 2008/01/30 22:43:41
Integrate:
[ 32816]
Fix memory leaks in XS_PerlIO_get_layers() by mortalizing
all variables pushed on the stack. Also make sure the loop
is using mXPUSHi() and not XPUSHi().
[ 32817]
Forgot to remove dTARGET with change #32816.
Affected files ...
... //depot/maint-5.10/perl/universal.c#2 integrate
Differences ...
==== //depot/maint-5.10/perl/universal.c#2 (text) ====
Index: perl/universal.c
--- perl/universal.c#1~32694~ 2007-12-22 01:23:09.000000000 -0800
+++ perl/universal.c 2008-01-30 14:43:41.000000000 -0800
@@ -951,7 +951,6 @@
}
if (gv && (io = GvIO(gv))) {
- dTARGET;
AV* const av = PerlIO_get_layers(aTHX_ input ?
IoIFP(io) : IoOFP(io));
I32 i;
@@ -969,25 +968,25 @@
if (details) {
XPUSHs(namok
- ? newSVpvn(SvPVX_const(*namsvp), SvCUR(*namsvp))
+ ? sv_2mortal(newSVpvn(SvPVX_const(*namsvp),
SvCUR(*namsvp)))
: &PL_sv_undef);
XPUSHs(argok
- ? newSVpvn(SvPVX_const(*argsvp), SvCUR(*argsvp))
+ ? sv_2mortal(newSVpvn(SvPVX_const(*argsvp),
SvCUR(*argsvp)))
: &PL_sv_undef);
if (flgok)
- XPUSHi(SvIVX(*flgsvp));
+ mXPUSHi(SvIVX(*flgsvp));
else
XPUSHs(&PL_sv_undef);
nitem += 3;
}
else {
if (namok && argok)
- XPUSHs(Perl_newSVpvf(aTHX_ "%"SVf"(%"SVf")",
+ XPUSHs(sv_2mortal(Perl_newSVpvf(aTHX_
"%"SVf"(%"SVf")",
SVfARG(*namsvp),
- SVfARG(*argsvp)));
+ SVfARG(*argsvp))));
else if (namok)
- XPUSHs(Perl_newSVpvf(aTHX_ "%"SVf,
- SVfARG(*namsvp)));
+ XPUSHs(sv_2mortal(Perl_newSVpvf(aTHX_ "%"SVf,
+ SVfARG(*namsvp))));
else
XPUSHs(&PL_sv_undef);
nitem++;
@@ -995,7 +994,7 @@
const IV flags = SvIVX(*flgsvp);
if (flags & PERLIO_F_UTF8) {
- XPUSHs(newSVpvs("utf8"));
+ XPUSHs(sv_2mortal(newSVpvs("utf8")));
nitem++;
}
}
End of Patch.