summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c3
-rw-r--r--pp_sys.c2
-rw-r--r--t/op/coresubs.t9
3 files changed, 11 insertions, 3 deletions
diff --git a/gv.c b/gv.c
index e22942523a..46d5ce0918 100644
--- a/gv.c
+++ b/gv.c
@@ -1354,9 +1354,8 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
case KEY_chdir:
case KEY_chomp: case KEY_chop:
case KEY_each: case KEY_eof: case KEY_exec:
- case KEY_gmtime:
case KEY_index: case KEY_keys:
- case KEY_localtime: case KEY_lock: case KEY_lstat:
+ case KEY_lock: case KEY_lstat:
case KEY_mkdir: case KEY_open: case KEY_pop:
case KEY_push: case KEY_rand: case KEY_read:
case KEY_recv: case KEY_reset:
diff --git a/pp_sys.c b/pp_sys.c
index 231388f21a..e6ff35574a 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4479,7 +4479,7 @@ PP(pp_gmtime)
{"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
- if (MAXARG < 1) {
+ if (MAXARG < 1 || (!TOPs && ((void)POPs, 1))) {
time_t now;
(void)time(&now);
when = (Time64_T)now;
diff --git a/t/op/coresubs.t b/t/op/coresubs.t
index 3339f4f410..fcae6b8bb9 100644
--- a/t/op/coresubs.t
+++ b/t/op/coresubs.t
@@ -370,6 +370,10 @@ test_proto "get$_" for qw '
pwent pwnam pwuid servbyname servbyport servent sockname sockopt
';
+test_proto 'gmtime';
+&CORE::gmtime;
+pass '&gmtime without args does not crash'; ++$tests;
+
test_proto 'hex', ff=>255;
test_proto 'int', 1.5=>1;
test_proto 'ioctl';
@@ -390,6 +394,11 @@ test_proto 'lcfirst', 'AA', 'aA';
test_proto 'length', 'aaa', 3;
test_proto 'link';
test_proto 'listen';
+
+test_proto 'localtime';
+&CORE::localtime;
+pass '&localtime without args does not crash'; ++$tests;
+
test_proto 'log';
test_proto "msg$_" for qw( ctl get rcv snd );