From: Peter Dintelmann Date: Fri, 11 Nov 2005 06:36:20 +0000 (-0800) Subject: [perl #37657] segfault with binmode ":pop" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=68b5363f7e6243d999097c647e922642ab157ba3;p=p5sagit%2Fp5-mst-13.2.git [perl #37657] segfault with binmode ":pop" From: Peter Dintelmann (via RT) Message-ID: p4raw-id: //depot/perl@26101 --- diff --git a/perlio.c b/perlio.c index 051c67f..5e1b855 100644 --- a/perlio.c +++ b/perlio.c @@ -1296,9 +1296,10 @@ PerlIO_apply_layers(pTHX_ PerlIO *f, const char *mode, const char *names) int PerlIO_binmode(pTHX_ PerlIO *f, int iotype, int mode, const char *names) { - PerlIO_debug("PerlIO_binmode f=%p %s %c %x %s\n", - (void*)f, PerlIOBase(f)->tab->name, iotype, mode, - (names) ? names : "(Null)"); + PerlIO_debug("PerlIO_binmode f=%p %s %c %x %s\n", (void*)f, + (PerlIOBase(f)) ? PerlIOBase(f)->tab->name : "(Null)", + iotype, mode, (names) ? names : "(Null)"); + if (names) { /* Do not flush etc. if (e.g.) switching encodings. if a pushed layer knows it needs to flush lower layers