[win32] integrate mainline
[p5sagit/p5-mst-13.2.git] / byterun.c
index 1ff3239..fe7d6d3 100644 (file)
--- a/byterun.c
+++ b/byterun.c
@@ -1,5 +1,5 @@
 /*
- *      Copyright (c) 1996 Malcolm Beattie
+ *      Copyright (c) 1996-1998 Malcolm Beattie
  *
  *      You may distribute under the terms of either the GNU General Public
  *      License or the Artistic License, as specified in the README file.
 #include "byterun.h"
 
 #ifdef INDIRECT_BGET_MACROS
-void byterun(bs)
-struct bytestream bs;
+void byterun(struct bytestream bs)
 #else
-void byterun(fp)
-FILE *fp;
+void byterun(FILE *fp)
 #endif /* INDIRECT_BGET_MACROS */
 {
+    dTHR;
     int insn;
     while ((insn = FGETC()) != EOF) {
        switch (insn) {
@@ -271,7 +270,7 @@ FILE *fp;
            {
                svindex arg;
                BGET_objindex(arg);
-               IoTOP_GV(sv) = arg;
+               *(SV**)&IoTOP_GV(sv) = arg;
                break;
            }
          case INSN_XIO_FMT_NAME:               /* 37 */
@@ -285,7 +284,7 @@ FILE *fp;
            {
                svindex arg;
                BGET_objindex(arg);
-               IoFMT_GV(sv) = arg;
+               *(SV**)&IoFMT_GV(sv) = arg;
                break;
            }
          case INSN_XIO_BOTTOM_NAME:            /* 39 */
@@ -299,7 +298,7 @@ FILE *fp;
            {
                svindex arg;
                BGET_objindex(arg);
-               IoBOTTOM_GV(sv) = arg;
+               *(SV**)&IoBOTTOM_GV(sv) = arg;
                break;
            }
          case INSN_XIO_SUBPROCESS:             /* 41 */
@@ -348,14 +347,14 @@ FILE *fp;
            {
                svindex arg;
                BGET_objindex(arg);
-               CvGV(sv) = arg;
+               *(SV**)&CvGV(sv) = arg;
                break;
            }
          case INSN_XCV_FILEGV:         /* 48 */
            {
                svindex arg;
                BGET_objindex(arg);
-               CvFILEGV(sv) = arg;
+               *(SV**)&CvFILEGV(sv) = arg;
                break;
            }
          case INSN_XCV_DEPTH:          /* 49 */
@@ -404,7 +403,7 @@ FILE *fp;
            {
                SSize_t arg;
                BGET_I32(arg);
-               AvFILL(sv) = arg;
+               AvFILLp(sv) = arg;
                break;
            }
          case INSN_XAV_MAX:            /* 56 */
@@ -722,140 +721,126 @@ FILE *fp;
                BSET_pregcomp(op, arg);
                break;
            }
-         case INSN_OP_PMSHORT:         /* 101 */
-           {
-               svindex arg;
-               BGET_objindex(arg);
-               cPMOP->op_pmshort = arg;
-               break;
-           }
-         case INSN_OP_PMFLAGS:         /* 102 */
+         case INSN_OP_PMFLAGS:         /* 101 */
            {
                U16 arg;
                BGET_U16(arg);
                cPMOP->op_pmflags = arg;
                break;
            }
-         case INSN_OP_PMPERMFLAGS:             /* 103 */
+         case INSN_OP_PMPERMFLAGS:             /* 102 */
            {
                U16 arg;
                BGET_U16(arg);
                cPMOP->op_pmpermflags = arg;
                break;
            }
-         case INSN_OP_PMSLEN:          /* 104 */
-           {
-               char arg;
-               BGET_U8(arg);
-               cPMOP->op_pmslen = arg;
-               break;
-           }
-         case INSN_OP_SV:              /* 105 */
+         case INSN_OP_SV:              /* 103 */
            {
                svindex arg;
                BGET_objindex(arg);
                cSVOP->op_sv = arg;
                break;
            }
-         case INSN_OP_GV:              /* 106 */
+         case INSN_OP_GV:              /* 104 */
            {
                svindex arg;
                BGET_objindex(arg);
-               cGVOP->op_gv = arg;
+               *(SV**)&cGVOP->op_gv = arg;
                break;
            }
-         case INSN_OP_PV:              /* 107 */
+         case INSN_OP_PV:              /* 105 */
            {
                pvcontents arg;
                BGET_pvcontents(arg);
                cPVOP->op_pv = arg;
                break;
            }
-         case INSN_OP_PV_TR:           /* 108 */
+         case INSN_OP_PV_TR:           /* 106 */
            {
                op_tr_array arg;
                BGET_op_tr_array(arg);
                cPVOP->op_pv = arg;
                break;
            }
-         case INSN_OP_REDOOP:          /* 109 */
+         case INSN_OP_REDOOP:          /* 107 */
            {
                opindex arg;
                BGET_objindex(arg);
                cLOOP->op_redoop = arg;
                break;
            }
-         case INSN_OP_NEXTOP:          /* 110 */
+         case INSN_OP_NEXTOP:          /* 108 */
            {
                opindex arg;
                BGET_objindex(arg);
                cLOOP->op_nextop = arg;
                break;
            }
-         case INSN_OP_LASTOP:          /* 111 */
+         case INSN_OP_LASTOP:          /* 109 */
            {
                opindex arg;
                BGET_objindex(arg);
                cLOOP->op_lastop = arg;
                break;
            }
-         case INSN_COP_LABEL:          /* 112 */
+         case INSN_COP_LABEL:          /* 110 */
            {
                pvcontents arg;
                BGET_pvcontents(arg);
                cCOP->cop_label = arg;
                break;
            }
-         case INSN_COP_STASH:          /* 113 */
+         case INSN_COP_STASH:          /* 111 */
            {
                svindex arg;
                BGET_objindex(arg);
                *(SV**)&cCOP->cop_stash = arg;
                break;
            }
-         case INSN_COP_FILEGV:         /* 114 */
+         case INSN_COP_FILEGV:         /* 112 */
            {
                svindex arg;
                BGET_objindex(arg);
-               cCOP->cop_filegv = arg;
+               *(SV**)&cCOP->cop_filegv = arg;
                break;
            }
-         case INSN_COP_SEQ:            /* 115 */
+         case INSN_COP_SEQ:            /* 113 */
            {
                U32 arg;
                BGET_U32(arg);
                cCOP->cop_seq = arg;
                break;
            }
-         case INSN_COP_ARYBASE:                /* 116 */
+         case INSN_COP_ARYBASE:                /* 114 */
            {
                I32 arg;
                BGET_I32(arg);
                cCOP->cop_arybase = arg;
                break;
            }
-         case INSN_COP_LINE:           /* 117 */
+         case INSN_COP_LINE:           /* 115 */
            {
                line_t arg;
                BGET_U16(arg);
                cCOP->cop_line = arg;
                break;
            }
-         case INSN_MAIN_START:         /* 118 */
+         case INSN_MAIN_START:         /* 116 */
            {
                opindex arg;
                BGET_objindex(arg);
                main_start = arg;
                break;
            }
-         case INSN_MAIN_ROOT:          /* 119 */
+         case INSN_MAIN_ROOT:          /* 117 */
            {
                opindex arg;
                BGET_objindex(arg);
                main_root = arg;
                break;
            }
-         case INSN_CURPAD:             /* 120 */
+         case INSN_CURPAD:             /* 118 */
            {
                svindex arg;
                BGET_objindex(arg);