Cloning a format whose outside has been undefined
authorFather Chrysostomos <sprout@cpan.org>
Sat, 30 Jun 2012 19:43:26 +0000 (12:43 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 30 Jun 2012 19:43:26 +0000 (12:43 -0700)
commitf2ead8b816519a65496980beeb8606954f270d43
tree4b3e892b6714f6c762a64639aa3b808828af6641
parent5578394101efd4d95c058c4f22f51763ae92ebc2
Cloning a format whose outside has been undefined

This has crashed ever since 71f882da8, because the format tries to
close over a pad that does not exist:

sub x {
    {my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u)}
    my $z;
    format =
@<<<
$z
.
}
undef &x;
write;

This commit adds checks for nonexistent pads, producing the â€˜Variable
is not available’ warning in cases like this.
pad.c
t/comp/form_scope.t