It has been hanging or unnecessarily using & since commit
d16269d835
caused spaces to be preserved in the prototype and stripped when
applied during sub call compilation. That commit did not update
B::Deparse accordingly.
my @reals;
# An unbackslashed @ or % gobbles up the rest of the args
1 while $proto =~ s/(?<!\\)([@%])[^\]]+$/$1/;
+ $proto =~ s/^\s*//;
while ($proto) {
- $proto =~ s/^(\\?[\$\@&%*_]|\\\[[\$\@&%*]+\]|;)//;
+ $proto =~ s/^(\\?[\$\@&%*_]|\\\[[\$\@&%*]+\]|;)\s*//;
my $chr = $1;
if ($chr eq "") {
return "&" if @args;
my $dproto = defined($proto) ? $proto : "undefined";
if (!$declared) {
return "$kid(" . $args . ")";
- } elsif ($dproto eq "") {
+ } elsif ($dproto =~ /^\s*\z/) {
return $kid;
} elsif ($dproto eq "\$" and is_scalar($exprs[0])) {
# is_scalar is an excessively conservative test here:
####
# Elements of %# should not be confused with $#{ array }
() = ${#}{'foo'};
+####
+# [perl #121050] Prototypes with whitespace
+sub _121050(\$ \$) { }
+_121050($a,$b);
+sub _121050empty( ) {}
+() = _121050empty() + 1;
+>>>>
+_121050 $a, $b;
+() = _121050empty + 1;