summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-07-14 15:23:29 +0100
committerDavid Mitchell <davem@iabyn.com>2017-07-27 11:30:23 +0100
commit12dc5f9406fbb8389be8b9f9406ad247ca07f210 (patch)
tree43c1d807a312fb0ded41d8e8ace03a6ef339a5d7 /pp_sys.c
parenta9372a4640d52f451e21d4f26b1105811563d003 (diff)
downloadperl-12dc5f9406fbb8389be8b9f9406ad247ca07f210.tar.gz
pp_readline,close,getc: explain NULL stack arg
add code comments to explain why these functions can sometimes be called with a NULL pointer on the stack. (feature introduced by v5.15.2-112-g30901a8)
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index c8e7a9f531..e3aee18694 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -664,6 +664,8 @@ PP(pp_open)
PP(pp_close)
{
dSP;
+ /* pp_coreargs pushes a NULL to indicate no args passed to
+ * CORE::close() */
GV * const gv =
MAXARG == 0 || (!TOPs && !POPs) ? PL_defoutgv : MUTABLE_GV(POPs);
@@ -1369,6 +1371,8 @@ PP(pp_select)
PP(pp_getc)
{
dSP; dTARGET;
+ /* pp_coreargs pushes a NULL to indicate no args passed to
+ * CORE::getc() */
GV * const gv =
MAXARG==0 || (!TOPs && !POPs) ? PL_stdingv : MUTABLE_GV(POPs);
IO *const io = GvIO(gv);