Todo tweaks
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 901995a..94fbc15 100644 (file)
--- a/op.c
+++ b/op.c
@@ -51,7 +51,7 @@ static PADOFFSET pad_findlex _((char* name, PADOFFSET newoff, U32 seq,
        CV* startcv, I32 cx_ix, I32 saweval));
 static OP *newDEFSVOP _((void));
 static OP *new_logop _((I32 type, I32 flags, OP **firstp, OP **otherp));
-static void simplify_sort(OP *o);
+static void simplify_sort _((OP *o));
 #endif
 
 STATIC char*
@@ -4763,10 +4763,8 @@ ck_glob(OP *o)
        gv = gv_fetchpv("CORE::GLOBAL::glob", FALSE, SVt_PVCV);
 
     if (gv && GvIMPORTED_CV(gv)) {
-       static int glob_index;
-
        append_elem(OP_GLOB, o,
-                   newSVOP(OP_CONST, 0, newSViv(glob_index++)));
+                   newSVOP(OP_CONST, 0, newSViv(PL_glob_index++)));
        o->op_type = OP_LIST;
        o->op_ppaddr = PL_ppaddr[OP_LIST];
        cLISTOPo->op_first->op_type = OP_PUSHMARK;
@@ -5050,7 +5048,7 @@ ck_sort(OP *o)
 #endif
 
     if (o->op_flags & OPf_STACKED)
-           simplify_sort(o);
+       simplify_sort(o);
     if (o->op_flags & OPf_STACKED) {                /* may have been cleared */
        OP *kid = cLISTOPo->op_first->op_sibling;       /* get past pushmark */
        OP *k;
@@ -5092,9 +5090,11 @@ ck_sort(OP *o)
 
     return o;
 }
-static void
+
+STATIC void
 simplify_sort(OP *o)
 {
+    dTHR;
     register OP *kid = cLISTOPo->op_first->op_sibling; /* get past pushmark */
     OP *k;
     int reversed;