summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/perlio.c b/perlio.c
index 76fe22548c..3cb591d9ff 100644
--- a/perlio.c
+++ b/perlio.c
@@ -759,6 +759,11 @@ PerlIO_get_layers(pTHX_ PerlIO *f)
PerlIOl *l = PerlIOBase(f);
while (l) {
+ /* There is some collusion in the implementation of
+ XS_PerlIO_get_layers - it knows that name and flags are
+ generated as fresh SVs here, and takes advantage of that to
+ "copy" them by taking a reference. If it changes here, it needs
+ to change there too. */
SV * const name = l->tab && l->tab->name ?
newSVpv(l->tab->name, 0) : &PL_sv_undef;
SV * const arg = l->tab && l->tab->Getarg ?