Change 26110 by [EMAIL PROTECTED] on 2005/11/13 11:44:30

        Integrate:
        [ 26108]
        BEGIN blocks should start a new stack, as they can be called as a
        side effect of "regular" Perl API calls within subroutines that have
        already cached the current stack's address. If they don't, any stack
        extension during the call may move the stack, rendering that cached
        value invalid without the cachee realising. (For example, PP code
        calling gv_fetchpv() which triggers a load of Errno.pm)

Affected files ...

... //depot/perl/op.c#721 integrate

Differences ...

==== //depot/perl/op.c#721 (text) ====
Index: perl/op.c
--- perl/op.c#720~26061~        Wed Nov  9 03:21:10 2005
+++ perl/op.c   Sun Nov 13 03:44:30 2005
@@ -4538,8 +4538,10 @@
            goto done;
 
        if (strEQ(s, "BEGIN") && !PL_error_count) {
+           dSP;
            const I32 oldscope = PL_scopestack_ix;
            ENTER;
+           PUSHSTACKi(PERLSI_REQUIRE);
            SAVECOPFILE(&PL_compiling);
            SAVECOPLINE(&PL_compiling);
 
@@ -4552,6 +4554,7 @@
 
            PL_curcop = &PL_compiling;
            PL_compiling.op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
+           POPSTACK;
            LEAVE;
        }
        else if (strEQ(s, "END") && !PL_error_count) {
End of Patch.

Reply via email to