Add SAVEt_COP_WARNINGS to ss_dup.
Nicholas Clark [Thu, 13 Apr 2006 10:46:32 +0000 (10:46 +0000)]
p4raw-id: //depot/perl@27785

sv.c

diff --git a/sv.c b/sv.c
index 3b9dfb8..c9debc6 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10681,6 +10681,21 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
 #endif
                break;
            }
+       case SAVEt_COP_WARNINGS:
+           {
+               void *optr = POPPTR(ss,ix);
+               TOPPTR(nss,ix) = ptr = any_dup(optr, proto_perl);
+               if (ptr != optr) {
+                   /* We duped something in the interpreter structure.  */
+                   ptr = POPPTR(ss,ix);
+                   TOPPTR(nss,ix) = DUP_WARNINGS((STRLEN*)ptr);
+               } else {
+                   /* I don't think that this happens, but it would mean that
+                      we (didn't) dup something shared.  */
+                   ptr = POPPTR(ss,ix);
+                   TOPPTR(nss,ix) = ptr;
+               }
+           }
        default:
            Perl_croak(aTHX_ "panic: ss_dup inconsistency (%"IVdf")", (IV) i);
        }