From: Marcus Holland-Moritz Date: Sat, 8 Nov 2008 18:31:09 +0000 (+0000) Subject: Make sure PerlIO::via doesn't leave its old GV's hanging X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d06e08c4f7bbcd6ede7e25da37c216be42278e5;p=p5sagit%2Fp5-mst-13.2.git Make sure PerlIO::via doesn't leave its old GV's hanging in the stash they were created in. Steal the idea from IO::File to just delete the stash entry after creating the GV. This fixes perl #59268. p4raw-id: //depot/perl@34779 --- diff --git a/ext/PerlIO/via/via.pm b/ext/PerlIO/via/via.pm index f7ab749..6ff804e 100644 --- a/ext/PerlIO/via/via.pm +++ b/ext/PerlIO/via/via.pm @@ -1,5 +1,5 @@ package PerlIO::via; -our $VERSION = '0.06'; +our $VERSION = '0.07'; use XSLoader (); XSLoader::load 'PerlIO::via'; 1; diff --git a/ext/PerlIO/via/via.xs b/ext/PerlIO/via/via.xs index 5e6ddd3..e50052c 100644 --- a/ext/PerlIO/via/via.xs +++ b/ext/PerlIO/via/via.xs @@ -91,6 +91,10 @@ PerlIOVia_method(pTHX_ PerlIO * f, const char *method, CV ** save, int flags, GvIOp(gv) = newIO(); s->fh = newRV((SV *) gv); s->io = GvIOp(gv); + if (gv) { + /* shamelessly stolen from IO::File's new_tmpfile() */ + hv_delete(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), G_DISCARD); + } } IoIFP(s->io) = PerlIONext(f); IoOFP(s->io) = PerlIONext(f);