This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_enteriter: add comment about setting cxt type
authorDavid Mitchell <davem@iabyn.com>
Sat, 26 Dec 2015 21:49:28 +0000 (21:49 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 09:19:19 +0000 (09:19 +0000)
pp_ctl.c

index 8fa013b..a65afbb 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2137,6 +2137,11 @@ PP(pp_enteriter)
     /* OPpITER_DEF (implicit $_) should only occur with a GV iter var */
     assert((cxflags & CXp_FOR_GV) || !(PL_op->op_private & OPpITER_DEF));
 
+    /* Note that this context is initially set as CXt_NULL. Further on
+     * down it's changed to one of the CXt_LOOP_*. Before it's changed,
+     * there mustn't be anything in the blk_loop substruct that requires
+     * freeing or undoing, in case we die in the meantime. And vice-versa.
+     */
     PUSHBLOCK(cx, cxflags, gimme, MARK, PL_savestack_ix);
     PUSHLOOP_FOR(cx, itervarp, itersave);