This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl.c: Clarify comment
authorFather Chrysostomos <sprout@cpan.org>
Wed, 13 Jun 2012 05:47:07 +0000 (22:47 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 15 Jun 2012 19:28:15 +0000 (12:28 -0700)
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.)

perl.c

diff --git a/perl.c b/perl.c
index d7e17b7..0864e34 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -737,10 +737,10 @@ perl_destruct(pTHXx)
     /* 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 */