Skip to content

Commit

Permalink
add diagnostics and asserts temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
demerphq committed Nov 23, 2012
1 parent f9f57fa commit 598a44d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Perl/Encoder/srl_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,10 @@ srl_dump_sv(pTHX_ srl_encoder_t *enc, SV *src)
PTABLE_store(ref_seenhash, src, (void *)BUF_POS_OFS(enc));
}
}
assert(weakref_ofs == 0);
if (weakref_ofs != 0) {
sv_dump(src);
assert(weakref_ofs == 0);
}
if (SvPOKp(src)) {
#ifdef MODERN_REGEXP
if (expect_false( svt == SVt_REGEXP ) ) {
Expand Down Expand Up @@ -935,6 +938,10 @@ srl_dump_sv(pTHX_ srl_encoder_t *enc, SV *src)
if (SvROK(src)) {
/* dump references */
SV *referent= SvRV(src);
if (!referent) {
sv_dump(src);
assert(referent);
}
if (SvWEAKREF(src)) {
weakref_ofs= BUF_POS_OFS(enc);
srl_buf_cat_char(enc, SRL_HDR_WEAKEN);
Expand Down

0 comments on commit 598a44d

Please sign in to comment.