If the random number of ops happens to be 0 the first time, then we
end up with a false positive, as evaluating '$x+<*>' after '<*>' will
vivify the *x glob.
# Use a random number of ops, so that the glob op does not reuse the
# same address each time, giving us false passes.
my($count,$count2);
- eval '$x+'x(rand() * 100) . '<*>';
+ eval '$x+'x(1+rand() * 100) . '<*>';
$count = sv_count();
- eval '$x+'x(rand() * 100) . '<*>';
+ eval '$x+'x(1+rand() * 100) . '<*>';
$count2 = sv_count();
is $count2, $count, 'no leak when partly iterated caller is freed';
}
eleak(2, 0, 'sub{<*>}');
# Use a random number of ops, so that the glob op does not reuse the same
# address each time, giving us false passes.
-leak(2, 0, sub { eval '$x+'x(rand() * 100) . '<*>'; },
+leak(2, 0, sub { eval '$x+'x(1 + rand() * 100) . '<*>'; },
'freeing partly iterated glob');
eleak(2, 0, 'goto sub {}', 'goto &sub in eval');