summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2022-06-20 15:07:02 +0100
committerTony Cook <tony@develop-help.com>2022-06-21 15:25:01 +1000
commit8bde4793b8b1dfdd6be2f3ddc1fdf4f7f5c5b01e (patch)
tree38fba1f57243f96294be1c9c1e3d06f8cd1e2872 /util.c
parent467fdaa25ef3a55b35d6672dc1d63eb8f6f18938 (diff)
downloadperl-8bde4793b8b1dfdd6be2f3ddc1fdf4f7f5c5b01e.tar.gz
Also log CopSTASHPV
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index f2332034a1..9f17ed3ec5 100644
--- a/util.c
+++ b/util.c
@@ -5218,9 +5218,10 @@ S_mem_log_common(enum mem_log_type mlt, const UV n,
PERL_UNUSED_RESULT(PerlLIO_write(fd, buf, len));
#ifdef USE_C_BACKTRACE
if(strchr(pmlenv,'c') && (mlt == MLT_NEW_SV)) {
- /* TODO: get caller package in here when we work out how */
len = my_snprintf(buf, sizeof(buf),
- " caller at %s line %d\n",
+ " caller %s at %s line %d\n",
+ /* CopSTASHPV can crash early on startup; use CopFILE to check */
+ CopFILE(PL_curcop) ? CopSTASHPV(PL_curcop) : "<unknown>",
CopFILE(PL_curcop), CopLINE(PL_curcop));
PERL_UNUSED_RESULT(PerlLIO_write(fd, buf, len));