Subject: | Infinite loop when run against code with recursive data structures |
When run on code that contains a recursive data structure that is referenced in a 'use constant'
declaration, Devel::Cover goes into an infinite loop and consumes all the memory on the
machine.
This only happens if the data structure involves two variables that reference each other; it does
not happen with a single variable that references itself.
It is also necessary to actually use the constant at least once to trigger the bug -- commenting
the last line in the attachment also removes the problem.
Subject: | boom-under-cover.pl |
#!/usr/bin/perl
use strict;
use warnings;
my %hash;
my %hash2;
$hash{hash1} = \%hash2;
$hash2{hash2} = \%hash;
sub get { return \%hash;}
use constant what => get();
my $x = what;