summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2012-09-04 21:55:22 +0200
committerNicholas Clark <nick@ccl4.org>2012-09-19 16:44:34 +0200
commit8b31d4e4418231a55583884517e227471284c99f (patch)
treef07775be1d96c4bc068313a0c5d4507cfcc659a1 /op.c
parent3f33d153bd4aa2e98501ccbc4ae56fabdbe3d985 (diff)
downloadperl-8b31d4e4418231a55583884517e227471284c99f.tar.gz
Document when the early return in Perl_newPROG() is bypassed completely.
Diffstat (limited to 'op.c')
-rw-r--r--op.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/op.c b/op.c
index 4c1c1a96b8..0b969e9172 100644
--- a/op.c
+++ b/op.c
@@ -3055,6 +3055,17 @@ Perl_newPROG(pTHX_ OP *o)
maybe other things) also take this path, because they set up
PL_main_start and PL_main_root directly, without generating an
optree.
+
+ If the parsing the main program aborts (due to parse errors,
+ or due to BEGIN or similar calling exit), then newPROG()
+ isn't even called, and hence this code path and its cleanups
+ are skipped. This shouldn't make a make a difference:
+ * a non-zero return from perl_parse is a failure, and
+ perl_destruct() should be called immediately.
+ * however, if exit(0) is called during the parse, then
+ perl_parse() returns 0, and perl_run() is called. As
+ PL_main_start will be NULL, perl_run() will return
+ promptly, and the exit code will remain 0.
*/
PL_comppad_name = 0;