Change 18820 by [EMAIL PROTECTED] on 2003/03/04 01:01:07

        Fixes bug #15654
        What happend was that a constant was freed, the pad released but
        the pad slot still held the SV, when pad slot was reallocated
        to be a target for a stringify, it did a sv_setpv on the target
        and the original SV was whiped out. When this SV was later on
        to new places using the constant, they got the wrong value.
        By replacing pad_free with pad_swipe for these cases, we
        won't have such a problem. (pad_swipe also removes the
        pointer to the original SV).

Affected files ...

... //depot/perl/op.c#547 edit

Differences ...

==== //depot/perl/op.c#547 (text) ====
Index: perl/op.c
--- perl/op.c#546~18801~        Sun Mar  2 07:24:22 2003
+++ perl/op.c   Mon Mar  3 17:01:07 2003
@@ -299,6 +299,18 @@
     case OP_CONST:
        SvREFCNT_dec(cSVOPo->op_sv);
        cSVOPo->op_sv = Nullsv;
+#ifdef USE_ITHREADS
+       /** Bug #15654
+         Even if op_clear does a pad_free for the target of the op,
+         pad_free doesn't actually remove the sv that exists in the bad
+         instead it lives on. This results in that it could be reused as 
+         a target later on when the pad was reallocated.
+       **/
+        if(o->op_targ) {
+          pad_swipe(o->op_targ,1);
+          o->op_targ = 0;
+        }
+#endif
        break;
     case OP_GOTO:
     case OP_NEXT:
End of Patch.

Reply via email to