This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: #28386: UNIVERSAL::VERSION segfaults if $VERSION not defined (w/ patch to fix...
authorDavid Dyck <david.dyck@fluke.com>
Thu, 8 Apr 2004 19:02:26 +0000 (12:02 -0700)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Fri, 9 Apr 2004 11:44:34 +0000 (11:44 +0000)
Message-ID: <Pine.LNX.4.51.0404081843290.29618@dd.tc.fluke.com>

p4raw-id: //depot/perl@22682

universal.c

index bac641c..78d30cb 100644 (file)
@@ -374,7 +374,11 @@ XS(XS_UNIVERSAL_VERSION)
                    vnumify(req),vnormal(req),vnumify(sv),vnormal(sv));
     }
 
-    ST(0) = vnumify(sv);
+    if (sv == (SV*)&PL_sv_undef) {
+       ST(0) = sv;
+    } else {
+       ST(0) = vnumify(sv);
+    }
 
     XSRETURN(1);
 }