summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-03-12 20:35:36 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-03-12 20:35:36 +0000
commit9ea6e965205e07bb7070635f11d3cc692765cd0c (patch)
tree5646800c2a008fefbd80ef61d84fd3b365f343a8 /op.c
parent258f629a78127140b4644bf8cc6ec15b387ab089 (diff)
downloadperl-9ea6e965205e07bb7070635f11d3cc692765cd0c.tar.gz
change#3067 failed package.t due to needless creation of $a and $b;
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
Diffstat (limited to 'op.c')
-rw-r--r--op.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/op.c b/op.c
index 220327ddca..08b27bedf1 100644
--- 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;