Add a break; to the end of the SAVEt_COP_WARNINGS case, and don't try
Nicholas Clark [Thu, 13 Apr 2006 13:02:30 +0000 (13:02 +0000)]
to dereference cop_hints if it's NULL.

p4raw-id: //depot/perl@27787

sv.c

diff --git a/sv.c b/sv.c
index c9debc6..d490e42 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10578,9 +10578,11 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
            i = POPINT(ss,ix);
            TOPINT(nss,ix) = i;
            ptr = POPPTR(ss,ix);
-           HINTS_REFCNT_LOCK;
-           ((COP *)ptr)->cop_hints->refcounted_he_refcnt++;
-           HINTS_REFCNT_UNLOCK;
+           if (((COP *)ptr)->cop_hints) {
+               HINTS_REFCNT_LOCK;
+               ((COP *)ptr)->cop_hints->refcounted_he_refcnt++;
+               HINTS_REFCNT_UNLOCK;
+           }
            TOPPTR(nss,ix) = ptr;
            if (i & HINT_LOCALIZE_HH) {
                hv = (HV*)POPPTR(ss,ix);
@@ -10696,6 +10698,7 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
                    TOPPTR(nss,ix) = ptr;
                }
            }
+           break;
        default:
            Perl_croak(aTHX_ "panic: ss_dup inconsistency (%"IVdf")", (IV) i);
        }