summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-05 08:48:35 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-05 08:48:35 -0800
commita46b39a853149ac3ddcaad16f3c7be0b86d520d0 (patch)
tree2e348384b86880b5278f7bebfec766ac1a3295e9 /op.c
parentbade7fbcf63fdefa0b4fd8a0321087860e413483 (diff)
downloadperl-a46b39a853149ac3ddcaad16f3c7be0b86d520d0.tar.gz
[perl #90030] sort with no arguments
This eliminates the error ‘sort is now a reserved word’, which was added for the sake of code that does close(sort) at about the time that sort became a keyword. As Tom Christiansen pointed out, it has been long enough. This error only occurred with ) or ; after the keyword. In other cases with no arguments, like {sort} and (sort,0), it was treated as an empty list. So this commit makes it follow that. Since the tests triggered it, this commit also fixes a crash caused by commit 540dd770, which, when seeing whether it can optimise something like ‘@a = sort @a’, assumes that there is something after the sort, and crashes when there isn’t, as in {@a = sort}.
Diffstat (limited to 'op.c')
-rw-r--r--op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/op.c b/op.c
index 709ef91d3f..b448defd67 100644
--- a/op.c
+++ b/op.c
@@ -9811,7 +9811,7 @@ S_inplace_aassign(pTHX_ OP *o) {
return;
assert(cUNOPx(modop)->op_first->op_type == OP_PUSHMARK);
- oright = cUNOPx(modop)->op_first->op_sibling;
+ if (!(oright = cUNOPx(modop)->op_first->op_sibling)) return;
if (modop->op_flags & OPf_STACKED) {
/* skip sort subroutine/block */