Devel::Peek::fill_mstats assumed that the argument was >= SVt_PV so
it crashed on brand new undef scalars. Use sv_grow, instead of
SvGROW. Since sv_grow also handles COWs, we can remove the special
COW check.
{
dTHX;
- if (SvIsCOW(sv)) sv_force_normal(sv);
if (SvREADONLY(sv))
croak("Cannot modify a readonly value");
- SvGROW(sv, sizeof(struct mstats_buffer)+1);
+ sv_grow(sv, sizeof(struct mstats_buffer)+1);
_fill_mstats((struct mstats_buffer*)SvPVX(sv),level);
SvCUR_set(sv, sizeof(struct mstats_buffer));
*SvEND(sv) = '\0';
');
SKIP: {
- skip "Not built with usemymalloc", 1
+ skip "Not built with usemymalloc", 2
unless $Config{usemymalloc} eq 'y';
my $x = __PACKAGE__;
ok eval { fill_mstats($x); 1 }, 'fill_mstats on COW scalar'
or diag $@;
+ my $y;
+ ok eval { fill_mstats($y); 1 }, 'fill_mstats on undef scalar';
}
# This is more a test of fbm_compile/pp_study (non) interaction than dumping