summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-01-12 22:23:16 +0100
committerNicholas Clark <nick@ccl4.org>2012-01-13 12:20:49 +0100
commitf69760828c2a1a26995258d477ac4a1da9db2e72 (patch)
tree08729ffa2dd64b820653fb4a6ef18c96e5309573 /sv.c
parent5731662b7617da2ff1626044f081de38b50a0ddc (diff)
downloadperl-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index 471caba014..7a11a79145 100644
--- a/sv.c
+++ b/sv.c
@@ -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;
}