Re: script wanted
[p5sagit/p5-mst-13.2.git] / ext / B / B / C.pm
index 8d71bb2..3011eb0 100644 (file)
@@ -7,7 +7,7 @@
 #
 package B::C::Section;
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 
 use B ();
 use base B::Section;
@@ -1012,10 +1012,11 @@ sub B::CV::save {
                     $cvstashname, $cvname); # debug
     }              
     $pv = '' unless defined $pv; # Avoid use of undef warnings
-    $symsect->add(sprintf("xpvcvix%d\t%s, %u, 0, %d, %s, 0, Nullhv, Nullhv, %s, s\\_%x, $xsub, $xsubany, Nullgv, \"\", %d, s\\_%x, (CV*)s\\_%x, 0x%x",
+    $symsect->add(sprintf("xpvcvix%d\t%s, %u, 0, %d, %s, 0, Nullhv, Nullhv, %s, s\\_%x, $xsub, $xsubany, Nullgv, \"\", %d, s\\_%x, (CV*)s\\_%x, 0x%x, 0x%x",
                          $xpvcv_ix, cstring($pv), length($pv), $cv->IVX,
                          $cv->NVX, $startfield, ${$cv->ROOT}, $cv->DEPTH,
-                        $$padlist, ${$cv->OUTSIDE}, $cv->CvFLAGS));
+                        $$padlist, ${$cv->OUTSIDE}, $cv->CvFLAGS,
+                       $cv->OUTSIDE_SEQ));
 
     if (${$cv->OUTSIDE} == ${main_cv()}){
        $init->add(sprintf("CvOUTSIDE(s\\_%x)=PL_main_cv;",$$cv));
@@ -1435,11 +1436,10 @@ typedef struct {
     long       xcv_depth;      /* >= 2 indicates recursive call */
     AV *       xcv_padlist;
     CV *       xcv_outside;
-#ifdef USE_5005THREADS
-    perl_mutex *xcv_mutexp;
-    struct perl_thread *xcv_owner;     /* current owner thread */
-#endif /* USE_5005THREADS */
     cv_flags_t xcv_flags;
+    U32                xcv_outside_seq; /* the COP sequence (at the point of our
+                                 * compilation) in the lexically enclosing
+                                 * sub */
 } XPVCV_or_similar;
 #define ANYINIT(i) i
 #else
@@ -1619,6 +1619,15 @@ EOT
     }
 EOT
     }
+    else {
+       print <<EOT;
+    if ((tmpgv = gv_fetchpv("0",TRUE, SVt_PV))) {/* $0 */
+        tmpsv = GvSV(tmpgv);
+        sv_setpv(tmpsv, argv[0]);
+        SvSETMAGIC(tmpsv);
+    }
+EOT
+    }
 
     print <<'EOT';
     if ((tmpgv = gv_fetchpv("\030",TRUE, SVt_PV))) {/* $^X */