This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make \N{unknown char} a syntax error
[perl5.git] / scope.c
diff --git a/scope.c b/scope.c
index 42e3af8..c767571 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -160,12 +160,9 @@ Perl_free_tmps(pTHX)
     /* XXX should tmps_floor live in cxstack? */
     const I32 myfloor = PL_tmps_floor;
     while (PL_tmps_ix > myfloor) {      /* clean up after last statement */
-#ifdef PERL_POISON
-        SV* const sv = PL_tmps_stack[PL_tmps_ix];
-        PoisonWith(sv, 1, sizeof(SV *), 0xAB);
-        PL_tmps_ix--;
-#else
        SV* const sv = PL_tmps_stack[PL_tmps_ix--];
+#ifdef PERL_POISON
+       PoisonWith(PL_tmps_stack + PL_tmps_ix + 1, 1, SV *, 0xAB);
 #endif
        if (sv && sv != &PL_sv_undef) {
            SvTEMP_off(sv);
@@ -1081,7 +1078,6 @@ Perl_leave_scope(pTHX_ I32 base)
                PL_curpad = AvARRAY(PL_comppad);
            else
                PL_curpad = NULL;
-           PL_comppad_name = (PADNAMELIST*)SSPOPPTR;
            break;
        case SAVEt_PADSV_AND_MORTALIZE:
            {
@@ -1196,6 +1192,7 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
 #ifdef DEBUGGING
     PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), PL_block_type[CxTYPE(cx)]);
     if (CxTYPE(cx) != CXt_SUBST) {
+       const char *gimme_text;
        PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp);
        PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%"UVxf"\n",
                      PTR2UV(cx->blk_oldcop));
@@ -1203,7 +1200,21 @@ Perl_cx_dump(pTHX_ PERL_CONTEXT *cx)
        PerlIO_printf(Perl_debug_log, "BLK_OLDSCOPESP = %ld\n", (long)cx->blk_oldscopesp);
        PerlIO_printf(Perl_debug_log, "BLK_OLDPM = 0x%"UVxf"\n",
                      PTR2UV(cx->blk_oldpm));
-       PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", cx->blk_gimme ? "LIST" : "SCALAR");
+       switch (cx->blk_gimme) {
+           case G_VOID:
+               gimme_text = "VOID";
+               break;
+           case G_SCALAR:
+               gimme_text = "SCALAR";
+               break;
+           case G_ARRAY:
+               gimme_text = "LIST";
+               break;
+           default:
+               gimme_text = "UNKNOWN";
+               break;
+       }
+       PerlIO_printf(Perl_debug_log, "BLK_GIMME = %s\n", gimme_text);
     }
     switch (CxTYPE(cx)) {
     case CXt_NULL: