Fix B and ByteLoader to cope with cop_warnings no longer being an SV.
[p5sagit/p5-mst-13.2.git] / ext / ByteLoader / bytecode.h
index 99ffd7f..7ba0236 100644 (file)
@@ -190,7 +190,7 @@ typedef char *pvindex;
                sv = (SV*)newHV();                      \
                break;                                  \
            default:                                    \
-               sv = NEWSV(0,0);                        \
+               sv = newSV(0);                          \
                SvUPGRADE(sv, (arg));                   \
            }
 #define BSET_newsvx(sv, arg) STMT_START {              \
@@ -347,7 +347,20 @@ typedef char *pvindex;
        mg_set(*hv_store(GvHV(gv_fetchpv("SIG", TRUE, SVt_PVHV)),       \
                name, strlen(name), cv, 0))
 
-#define BSET_xhv_name(hv, name)        Perl_hv_name_set(aTHX_ (HV*)hv, name, strlen(name), 0)
+#define BSET_xhv_name(hv, name)        hv_name_set((HV*)hv, name, strlen(name), 0)
+#define BSET_cop_arybase(c, b) CopARYBASE_set(c, b)
+#define BSET_cop_warnings(c, w) \
+       STMT_START {                                                    \
+           if (specialWARN((STRLEN *)w)) {                             \
+               c->cop_warnings = (STRLEN *)w;                          \
+           } else {                                                    \
+               STRLEN len;                                             \
+               const char *const p = SvPV_const(w, len);               \
+               c->cop_warnings =                                       \
+                   Perl_new_warnings_bitfield(aTHX_ NULL, p, len);     \
+               SvREFCNT_dec(w);                                        \
+           }                                                           \
+       } STMT_END
 
 /* NOTE: the bytecode header only sanity-checks the bytecode. If a script cares about
  * what version of Perl it's being called under, it should do a 'use 5.006_001' or