#define STORE_SCALAR(pv, len) STORE_PV_LEN(pv, len, SX_SCALAR, SX_LSCALAR)
/*
- * Store undef in arrays and hashes without recursing through store().
+ * Store &PL_sv_undef in arrays without recursing through store().
*/
-#define STORE_UNDEF() \
+#define STORE_SV_UNDEF() \
STMT_START { \
cxt->tagnum++; \
- PUTMARK(SX_UNDEF); \
+ PUTMARK(SX_SV_UNDEF); \
} STMT_END
/*
sav = av_fetch(av, i, 0);
if (!sav) {
TRACEME(("(#%d) undef item", i));
- STORE_UNDEF();
+ STORE_SV_UNDEF();
continue;
}
TRACEME(("(#%d) item", i));
use Storable qw(freeze nfreeze thaw);
-print "1..19\n";
+print "1..20\n";
$a = 'toto';
$b = \$a;
thaw $frozen; # used to segfault here
ok 19, 1;
+
+$a = []; $#$a = 2; $a->[1] = undef;
+$b = thaw freeze $a;
+@a = map { ~~ exists $a->[$_] } 0 .. $#$a;
+@b = map { ~~ exists $b->[$_] } 0 .. $#$b;
+ok 20, "@a" eq "@b";