summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-26 10:12:01 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-26 18:21:46 -0700
commit94ec06bc74ba3a61d5daddf3adeaa53459960136 (patch)
tree9e06d2a9f4684d206c3b40303e55934550c52cee /pp.c
parent3e6568b4d097eff42dadf96c5f05b8b02fd9dc29 (diff)
downloadperl-94ec06bc74ba3a61d5daddf3adeaa53459960136.tar.gz
&CORE::rand()
This commit allows &CORE::rand to be called through references and via ampersand syntax. pp_rand is modified to take into account the nulls pushed on to the stack in pp_coreargs, which happens because pp_coreargs has no other way to tell rand how many arguments it’s actually getting. See commit 0163043a for details.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 78b1271050..fe2c4ab389 100644
--- a/pp.c
+++ b/pp.c
@@ -2813,6 +2813,9 @@ PP(pp_rand)
NV value;
if (MAXARG < 1)
value = 1.0;
+ else if (!TOPs) {
+ value = 1.0; (void)POPs;
+ }
else
value = POPn;
if (value == 0.0)