From 10cea94582148cd5bcccfa2723247332e1743303 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 1 Sep 2010 03:00:38 +0200 Subject: [perl #77492] open $fh, ">", \*glob causes SEGV PerlIO_layer_from_ref must not treat a real glob as a scalar. This function was not updated when SVt_PVGV was moved before SVt_PVLV. --- perlio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perlio.c') diff --git a/perlio.c b/perlio.c index 5df704e54a..c83b2bb58e 100644 --- a/perlio.c +++ b/perlio.c @@ -1449,7 +1449,7 @@ PerlIO_layer_from_ref(pTHX_ SV *sv) /* * For any scalar type load the handler which is bundled with perl */ - if (SvTYPE(sv) < SVt_PVAV) { + if (SvTYPE(sv) < SVt_PVAV && !isGV_with_GP(sv)) { PerlIO_funcs *f = PerlIO_find_layer(aTHX_ STR_WITH_LEN("scalar"), 1); /* This isn't supposed to happen, since PerlIO::scalar is core, * but could happen anyway in smaller installs or with PAR */ -- cgit v1.2.1