Deparse crashed on argless sort()
authorDavid Mitchell <davem@iabyn.com>
Tue, 9 Oct 2012 10:59:37 +0000 (11:59 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 10 Oct 2012 15:39:21 +0000 (16:39 +0100)
This would crash
    @a = sort;

(Test will come in a separate commit)

dist/B-Deparse/Deparse.pm

index b36a0c0..354e30f 100644 (file)
@@ -2753,6 +2753,7 @@ sub indirop {
        }
     } elsif (
        !$indir && $name eq "sort"
+      && !null($op->first->sibling)
       && $op->first->sibling->name eq 'entersub'
     ) {
        # We cannot say sort foo(bar), as foo will be interpreted as a