Skip to content

Commit 514c4e2

Browse files
committed
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 c2b1997 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()`.
1 parent 9365cdf commit 514c4e2

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

dump.c

-6
Original file line numberDiff line numberDiff line change
@@ -2393,12 +2393,6 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
23932393
#endif
23942394
(void)PerlIO_putc(file, '\n');
23952395
}
2396-
{
2397-
MAGIC * const mg = mg_find(sv, PERL_MAGIC_symtab);
2398-
if (mg && mg->mg_obj) {
2399-
Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%" UVxf "\n", PTR2UV(mg->mg_obj));
2400-
}
2401-
}
24022396
{
24032397
const char * const hvname = HvNAME_get(sv);
24042398
if (hvname) {

sv.c

-1
Original file line numberDiff line numberDiff line change
@@ -5895,7 +5895,6 @@ Perl_sv_magicext(pTHX_ SV *const sv, SV *const obj, const int how,
58955895
how == PERL_MAGIC_arylen ||
58965896
how == PERL_MAGIC_regdata ||
58975897
how == PERL_MAGIC_regdatum ||
5898-
how == PERL_MAGIC_symtab ||
58995898
(SvTYPE(obj) == SVt_PVGV &&
59005899
(GvSV(obj) == sv || GvHV(obj) == (const HV *)sv
59015900
|| GvAV(obj) == (const AV *)sv || GvCV(obj) == (const CV *)sv

0 commit comments

Comments
 (0)