From 63ff8b3b08583fd61a2f1fe3e7f4aff83ba59154 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Wed, 19 Mar 2025 15:54:08 +0000 Subject: [PATCH] Remove redundant code that handles mg_obj of PERL_MAGIC_symtab The (badly-named) PERL_MAGIC_symtab no longer uses the `mg_obj` field, ever since it was reshaped by c2b1997a64b4faf9c52a72614bfeb0a1f6eeeba8 This magic is only applied in one place (at time of writing, toke.c line 10711) with the `obj` field set to NULL. Therefore, there is no point having code in `dump.c` to print it if non-NULL, nor in `sv.c` to special-case setting a non-NULL value in `sv_magicext()`. --- dump.c | 6 ------ sv.c | 1 - 2 files changed, 7 deletions(-) diff --git a/dump.c b/dump.c index c3d82ec2de04..780a2df3f879 100644 --- a/dump.c +++ b/dump.c @@ -2393,12 +2393,6 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo #endif (void)PerlIO_putc(file, '\n'); } - { - MAGIC * const mg = mg_find(sv, PERL_MAGIC_symtab); - if (mg && mg->mg_obj) { - Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%" UVxf "\n", PTR2UV(mg->mg_obj)); - } - } { const char * const hvname = HvNAME_get(sv); if (hvname) { diff --git a/sv.c b/sv.c index e83fd763591d..25a22ef68875 100644 --- a/sv.c +++ b/sv.c @@ -5895,7 +5895,6 @@ Perl_sv_magicext(pTHX_ SV *const sv, SV *const obj, const int how, how == PERL_MAGIC_arylen || how == PERL_MAGIC_regdata || how == PERL_MAGIC_regdatum || - how == PERL_MAGIC_symtab || (SvTYPE(obj) == SVt_PVGV && (GvSV(obj) == sv || GvHV(obj) == (const HV *)sv || GvAV(obj) == (const AV *)sv || GvCV(obj) == (const CV *)sv