Re: #28386: UNIVERSAL::VERSION segfaults if $VERSION not defined (w/ patch to fix...
David Dyck [Thu, 8 Apr 2004 19:02:26 +0000 (12:02 -0700)]
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);
 }