Permalink
Browse files

If Perl_hv_backreferences_p is not defined then use normal magic chec…

…k to find weakrefs
  • Loading branch information...
1 parent bdf9e87 commit 8806284323a9caff4f5df571f39cfd8abdb29842 @demerphq demerphq committed Jan 21, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 Perl/Encoder/srl_encoder.c
@@ -989,11 +989,15 @@ srl_dump_sv(pTHX_ srl_encoder_t *enc, SV *src)
DEBUG_ASSERT_BUF_SANE(enc);
if ( SvMAGICAL(src) ) {
SvGETMAGIC(src);
+#ifdef Perl_hv_backreferences_p
if (svt != SVt_PVHV)
+#endif
mg = mg_find(src, PERL_MAGIC_backref);
}
+#ifdef Perl_hv_backreferences_p
if (svt == SVt_PVHV)
backrefs= *Perl_hv_backreferences_p(aTHX_ (HV *)src);
+#endif
if ( mg || backrefs ) {
PTABLE_t *weak_seenhash= SRL_GET_WEAK_SEENHASH(enc);
PTABLE_ENTRY_t *pe= PTABLE_find(weak_seenhash, src);

0 comments on commit 8806284

Please sign in to comment.