Remove the $ENV{PERL_CORE} boilerplate from Storable's tests.
[p5sagit/p5-mst-13.2.git] / ext / Opcode / Opcode.xs
index a699ebf..4bcb2e4 100644 (file)
@@ -132,7 +132,7 @@ new_opset(pTHX_ SV *old_opset)
        opset = newSVsv(old_opset);
     }
     else {
-       opset = NEWSV(1156, opset_len);
+       opset = newSV(opset_len);
        Zero(SvPVX_const(opset), opset_len + 1, char);
        SvCUR_set(opset, opset_len);
        (void)SvPOK_only(opset);
@@ -145,7 +145,7 @@ new_opset(pTHX_ SV *old_opset)
 static int
 verify_opset(pTHX_ SV *opset, int fatal)
 {
-    const char *err = Nullch;
+    const char *err = NULL;
     dMY_CXT;
 
     if      (!SvOK(opset))              err = "undefined";
@@ -269,7 +269,7 @@ PPCODE:
 
     if (strNE(HvNAME_get(hv),"main")) {
         /* make it think it's in main:: */
-       Perl_hv_name_set(aTHX_ hv, "main", 4, 0);
+       hv_name_set(hv, "main", 4, 0);
         hv_store(hv,"_",1,(SV *)PL_defgv,0);  /* connect _ to global */
         SvREFCNT_inc((SV *)PL_defgv);  /* want to keep _ around! */
     }
@@ -314,6 +314,10 @@ PPCODE:
     dummy_hv = save_hash(PL_incgv);
     GvHV(PL_incgv) = (HV*)SvREFCNT_inc(GvHV(gv_HVadd(gv_fetchpv("INC",TRUE,SVt_PVHV))));
 
+    /* Invalidate ISA and method caches */
+    ++PL_sub_generation;
+    hv_clear(PL_stashcache);
+
     PUSHMARK(SP);
     perl_call_sv(codesv, GIMME|G_EVAL|G_KEEPERR); /* use callers context */
     sv_free( (SV *) dummy_hv);  /* get rid of what save_hash gave us*/
@@ -466,8 +470,7 @@ PPCODE:
        }
        else if (SvPOK(bitspec) && SvCUR(bitspec) == (STRLEN)opset_len) {
            int b, j;
-           STRLEN n_a;
-           const char * const bitmap = SvPV(bitspec,n_a);
+           const char * const bitmap = SvPV_nolen_const(bitspec);
            int myopcode = 0;
            for (b=0; b < opset_len; b++) {
                const U16 bits = bitmap[b];