Check for definedness of sv before calling sv_derived_from()
Marcus Holland-Moritz [Thu, 1 Jul 2004 14:30:05 +0000 (14:30 +0000)]
to prevent "Use of uninitialized value..." warning.

p4raw-id: //depot/perl@23021

universal.c

index 6b2214d..ef4d95b 100644 (file)
@@ -374,7 +374,7 @@ XS(XS_UNIVERSAL_VERSION)
                    vnumify(req),vnormal(req),vnumify(sv),vnormal(sv));
     }
 
-    if ( sv_derived_from(sv, "version") ) {
+    if ( SvOK(sv) && sv_derived_from(sv, "version") ) {
        ST(0) = vnumify(sv);
     } else {
        ST(0) = sv;