This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add a "return NORMAL" to a DIE at the end of a function to prevent compiler warnings...
[perl5.git] / cop.h
diff --git a/cop.h b/cop.h
index fc19494..93154c8 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -114,6 +114,7 @@ typedef struct jmpenv JMPENV;
     STMT_START {                                                       \
        DEBUG_l(Perl_deb(aTHX_ "popping jumplevel was %p, now %p\n",    \
                         (void*)PL_top_env, (void*)cur_env.je_prev));                   \
+       assert(PL_top_env == &cur_env);                                 \
        PL_top_env = cur_env.je_prev;                                   \
     } STMT_END
 
@@ -246,12 +247,17 @@ struct cop {
 #define CopARYBASE_set(c, b) STMT_START { \
        if (b || ((c)->cop_hints & HINT_ARYBASE)) {                     \
            (c)->cop_hints |= HINT_ARYBASE;                             \
-           if ((c) == &PL_compiling)                                   \
-               PL_hints |= HINT_LOCALIZE_HH | HINT_ARYBASE;            \
-           (c)->cop_hints_hash                                         \
-              = Perl_refcounted_he_new(aTHX_ (c)->cop_hints_hash,      \
+           if ((c) == &PL_compiling) {                                 \
+               SV *val = newSViv(b);                                   \
+               (void)hv_stores(GvHV(PL_hintgv), "$[", val);            \
+               mg_set(val);                                            \
+               PL_hints |= HINT_ARYBASE;                               \
+           } else {                                                    \
+               (c)->cop_hints_hash                                     \
+                  = Perl_refcounted_he_new(aTHX_ (c)->cop_hints_hash,  \
                                        newSVpvs_flags("$[", SVs_TEMP), \
                                        sv_2mortal(newSViv(b)));        \
+           }                                                           \
        }                                                               \
     } STMT_END