This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add CopFILEAVn() and use it when cleaning up COP pointers
authorTony Cook <tony@develop-help.com>
Thu, 21 Oct 2021 03:16:54 +0000 (14:16 +1100)
committerTony Cook <tony@develop-help.com>
Mon, 15 Nov 2021 00:35:42 +0000 (11:35 +1100)
commit9c913148860b0e83e6149d37e86cdb29663ee812
tree7f710ef653664ac0a0bb48561554f5a45e8ca8ce
parent9bce496f83cb607054f21c015c5f377c24c86bfd
Add CopFILEAVn() and use it when cleaning up COP pointers

On threaded builds CopFILEAV() calls gv_fetchfile(), which always
created the *{"::_<filenamehere"} glob, so the attempted clean up
here could recreate the glob, even if it has already been removed
when cleaning up a string eval.

To avoid this, add CopFILEAVn() that never creates the glob,
nor the AV so that the clean up never adds new objects.

This change makes the check for PL_phase unnecessary, but that check
is much cheaper than the call for gv_fetchfile_flags() that the
macro hides, so retain the check.
cop.h
embed.fnc
embed.h
gv.c
gv.h
inline.h
op.c
proto.h