zen% cat t0
#!/usr/bin/perl -w
for (my $i = 0; $i < 2; $i++) {
my $j = $i + 1;
retry:
warn "i: $i j: $j\n";
if ($i < $j) {
$j--;
goto retry;
}
}
zen% /opt/perl-5.8.0/bin/perl t0
i: 0 j: 1
i: 0 j: 0
i: 1 j: 2
Use of uninitialized value in concatenation (.) or string at t0 line 4
+.
i: 1 j:
Use of uninitialized value in numeric lt (<) at t0 line 6.
Segmentation fault (core dumped)
zen% /opt/perl-5.8.1/bin/perl t0
i: 0 j: 1
i: 0 j: 0
i: 1 j: 2
i: 1 j: 1
zen%
Which I'd guess means there was a bug such that using goto to jump up to an enclosing scope after the introduction of some lexicals in that scope introduced an instability that would initially manifest as the lexical becoming undefined, and could eventually lead to a core dump.
Hugo |