This comment was added by commit 17fbfdf. Without looking at the
diff, it’s not clear that ‘Do this now’ refers to setting PL_curcop,
rather than destroying the main CV. Also, there was a missing verb,
leading to confusion. (I first inferred ‘cause’ when reading it,
but it is actually ‘expect’, based on inspecting the code in
sv.c:S_new_SV.)
/* We must account for everything. */
/* Destroy the main CV and syntax tree */
- /* Do this now, because destroying ops can cause new SVs to be generated
- in Perl_pad_swipe, and when running with -DDEBUG_LEAKING_SCALARS they
- PL_curcop to point to a valid op from which the filename structure
- member is copied. */
+ /* Set PL_curcop now, because destroying ops can cause new SVs
+ to be generated in Perl_pad_swipe, and when running with
+ -DDEBUG_LEAKING_SCALARS they expect PL_curcop to point to a valid
+ op from which the filename structure member is copied. */
PL_curcop = &PL_compiling;
if (PL_main_root) {
/* ensure comppad/curpad to refer to main's pad */