change#3067 failed package.t due to needless creation of $a and $b;
authorGurusamy Sarathy <gsar@cpan.org>
Fri, 12 Mar 1999 20:35:36 +0000 (20:35 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Fri, 12 Mar 1999 20:35:36 +0000 (20:35 +0000)
fixed to do that only for C<sort BLOCK|CODE @foo>, not C<sort(@foo)>

p4raw-link: @3067 on //depot/perl: 39ab52836386b91d2e2c323dd305cf42e6be3133

p4raw-id: //depot/perl@3106

op.c

diff --git a/op.c b/op.c
index 220327d..08b27be 100644 (file)
--- a/op.c
+++ b/op.c
@@ -5114,12 +5114,7 @@ ck_sort(OP *o)
        o->op_private |= OPpLOCALE;
 #endif
 
-    if (o->op_type == OP_SORT) {
-        GvMULTI_on(gv_fetchpv("a", TRUE, SVt_PV)); 
-        GvMULTI_on(gv_fetchpv("b", TRUE, SVt_PV)); 
-    }
-
-    if (o->op_flags & OPf_STACKED)
+    if (o->op_type == OP_SORT && o->op_flags & OPf_STACKED)
        simplify_sort(o);
     if (o->op_flags & OPf_STACKED) {                /* may have been cleared */
        OP *kid = cLISTOPo->op_first->op_sibling;       /* get past pushmark */
@@ -5172,6 +5167,8 @@ simplify_sort(OP *o)
     int reversed;
     if (!(o->op_flags & OPf_STACKED))
        return;
+    GvMULTI_on(gv_fetchpv("a", TRUE, SVt_PV)); 
+    GvMULTI_on(gv_fetchpv("b", TRUE, SVt_PV)); 
     kid = kUNOP->op_first;                             /* get past rv2gv */
     if (kid->op_type != OP_SCOPE)
        return;