diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-01-12 22:23:16 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2012-01-13 12:20:49 +0100 |
commit | f69760828c2a1a26995258d477ac4a1da9db2e72 (patch) | |
tree | 08729ffa2dd64b820653fb4a6ef18c96e5309573 /sv.c | |
parent | 5731662b7617da2ff1626044f081de38b50a0ddc (diff) | |
download | perl-f69760828c2a1a26995258d477ac4a1da9db2e72.tar.gz |
Better panic diagnostics in Perl_sv_del_backref()
If panicing with a croak(), include in the panic message the values which
caused the croak. This reveals something about the cause of the panic, and
more subtly, which of the two possible panic locations this is.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -5565,7 +5565,8 @@ Perl_sv_del_backref(pTHX_ SV *const tsv, SV *const sv) } if (!svp || !*svp) - Perl_croak(aTHX_ "panic: del_backref"); + Perl_croak(aTHX_ "panic: del_backref, svp=%p, *svp=%p", + svp, svp ? *svp : NULL); if (SvTYPE(*svp) == SVt_PVAV) { #ifdef DEBUGGING @@ -5620,7 +5621,7 @@ Perl_sv_del_backref(pTHX_ SV *const tsv, SV *const sv) else { /* optimisation: only a single backref, stored directly */ if (*svp != sv) - Perl_croak(aTHX_ "panic: del_backref"); + Perl_croak(aTHX_ "panic: del_backref, *svp=%p, sv=%p", *svp, sv); *svp = NULL; } |