Deep in the bowels of creating new and exciting bugs, I managed to
Nicholas Clark [Sat, 15 Apr 2006 19:17:51 +0000 (19:17 +0000)]
segfault the uninitialised value reporting code. This protects against
the segfault.

p4raw-id: //depot/perl@27818

sv.c

diff --git a/sv.c b/sv.c
index 08d9b6a..8171c7f 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -12089,8 +12089,10 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
         * or are optimized away, then it's unambiguous */
        o2 = NULL;
        for (kid=o; kid; kid = kid->op_sibling) {
+           SV *sv;
            if (kid &&
-               (    (kid->op_type == OP_CONST && SvOK(cSVOPx_sv(kid)))
+               (    (kid->op_type == OP_CONST && (sv = cSVOPx_sv(kid))
+                     && SvOK(sv))
                  || (kid->op_type == OP_NULL  && ! (kid->op_flags & OPf_KIDS))
                  || (kid->op_type == OP_PUSHMARK)
                )