This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
First stab at not automatically creating an unused SV for GvSV
[perl5.git] / sv.c
diff --git a/sv.c b/sv.c
index 03a2589..3d12232 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -441,7 +441,11 @@ static void
 do_clean_named_objs(pTHX_ SV *sv)
 {
     if (SvTYPE(sv) == SVt_PVGV && GvGP(sv)) {
-       if ( SvOBJECT(GvSV(sv)) ||
+       if ((
+#ifdef PERL_DONT_CREATE_GVSV
+            GvSV(sv) &&
+#endif
+            SvOBJECT(GvSV(sv))) ||
             (GvAV(sv) && SvOBJECT(GvAV(sv))) ||
             (GvHV(sv) && SvOBJECT(GvHV(sv))) ||
             (GvIO(sv) && SvOBJECT(GvIO(sv))) ||