Re: [PATCH] Re: ByteLoader and MSWin32
Adrian M. Enache [Thu, 4 Sep 2003 20:09:06 +0000 (23:09 +0300)]
Message-ID: <20030904170906.GA1235@ratsnest.hole>

p4raw-id: //depot/perl@21032

bytecode.pl
ext/B/B/Bytecode.pm
ext/ByteLoader/bytecode.h
ext/ByteLoader/byterun.c

index bfe7502..c3c3dc7 100644 (file)
@@ -452,7 +452,7 @@ op_pmreplroot       cPMOP->op_pmreplroot                    opindex
 op_pmreplstart cPMOP->op_pmreplstart                   opindex
 op_pmnext      *(OP**)&cPMOP->op_pmnext                opindex
 #ifdef USE_ITHREADS
-op_pmstashpv   cPMOP->op_pmstashpv                     pvindex
+op_pmstashpv   cPMOP                                   pvindex         x
 op_pmreplrootpo        cPMOP->op_pmreplroot                    OP*/PADOFFSET
 #else
 op_pmstash     *(SV**)&cPMOP->op_pmstash               svindex
index 8580885..cce9948 100644 (file)
@@ -735,15 +735,17 @@ sub compile {
     }
     if ($scan) {
        my $f;
-       open $f, $scan
-           or bwarn("cannot rescan '$_'"), next;
-       while (<$f>) {
-           /^#\s*line\s+\d+\s+("?)(.*)\1/ and $files{$2} = 1;
-           /^#/ and next;
-           if (/\bgoto\b/ && !$keep_syn) {
-               bwarn "keeping the syntax tree: \"goto\" op found";
-               keep_syn;
+       if (open $f, $scan) {
+           while (<$f>) {
+               /^#\s*line\s+\d+\s+("?)(.*)\1/ and $files{$2} = 1;
+               /^#/ and next;
+               if (/\bgoto\b\s*[^&]/ && !$keep_syn) {
+                   bwarn "keeping the syntax tree: \"goto\" op found";
+                   keep_syn;
+               }
            }
+       } else {
+           bwarn "cannot rescan '$scan'";
        }
        close $f;
     }
index 667de7d..0224625 100644 (file)
@@ -215,6 +215,8 @@ typedef char *pvindex;
        return 0;                               \
     } STMT_END
 
+#define BSET_op_pmstashpv(op, arg)     PmopSTASHPV_set(op, arg)
+
 /* 
  * stolen from toke.c: better if that was a function.
  * in toke.c there are also #ifdefs for dosish systems and i/o layers
index c93b6cd..af55af6 100644 (file)
@@ -817,7 +817,7 @@ byterun(pTHX_ register struct byteloader_state *bstate)
            {
                pvindex arg;
                BGET_pvindex(arg);
-               cPMOP->op_pmstashpv = arg;
+               BSET_op_pmstashpv(cPMOP, arg);
                break;
            }
          case INSN_OP_PMREPLROOTPO:            /* 109 */