In commit
99fc7eca4 I wrote some erroneous comments and modified a
test such that it no longer tested what I was supposed to test.
I did not realise that the bug only affected globs for built-in varia-
bles, specifically those that pop into existence when looked at:
$ perl5.10.1 -e '$x = "y"; readdir $x'
Bad symbol for dirhandle at -e line 1.
$ perl5.10.1 -e '$x = "."; readdir $x'
Bus error
In commit
99fc7eca4, I actually removed the ultimate cause of the bug,
restoring the 5.8.x behaviour of not dying with ‘Bad symbol’, because
there *is* a symbol, even if it’s not a valid handle.
This commit removes the erroneous comments and makes the test less
sensitive to output, since it’s just supposed to be testing that no
crash happens.
# See that perl does not segfault upon readdir($x=".");
# http://rt.perl.org/rt3/Ticket/Display.html?id=68182
-# This test has subsequently changed to use "x", because *. now always
-# returns a glob (because of the $. variable), even in the non-vivifying
-# context supplied by readdir (which implies *{}). "x" triggers the same
-# conditions under which the segfault originally occurred.
-fresh_perl_like(<<'EOP', qr/^Bad symbol for dirhandle at -/, {}, 'RT #68182');
+fresh_perl_like(<<'EOP', qr/^no crash/, {}, 'RT #68182');
+ eval {
my $x = "x";
my @files = readdir($x);
+ };
+ print "no crash";
EOP
done_testing();