This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #37694] segfault with PerlIO::get_layers()
[perl5.git] / universal.c
index 1f63563..10dddb5 100644 (file)
@@ -850,7 +850,7 @@ XS(XS_PerlIO_get_layers)
        if (!isGV(sv)) {
             if (SvROK(sv) && isGV(SvRV(sv)))
                  gv = (GV*)SvRV(sv);
        if (!isGV(sv)) {
             if (SvROK(sv) && isGV(SvRV(sv)))
                  gv = (GV*)SvRV(sv);
-            else
+            else if (SvPOKp(sv))
                  gv = gv_fetchsv(sv, FALSE, SVt_PVIO);
        }
 
                  gv = gv_fetchsv(sv, FALSE, SVt_PVIO);
        }