summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@wiw.org>2001-06-17 18:34:46 +0530
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-21 12:30:57 +0000
commitf206cdda513dcda39e1ced147a33b8497001ef8b (patch)
tree88e24c87044ac3c26734865c4fb8c1485c7c751b /pp_hot.c
parentc00330f1da4c399b60290728912d273d8459ad00 (diff)
downloadperl-f206cdda513dcda39e1ced147a33b8497001ef8b.tar.gz
Re: Opinion on undef lvalue
Message-ID: <20010617130446.B27925@lustre.linux.in> Allow lvalue subs to return undef in array context. p4raw-id: //depot/perl@10777
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 5d43a7985e..d5da0ae8a1 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2315,18 +2315,16 @@ PP(pp_leavesublv)
else if (gimme == G_ARRAY) {
EXTEND_MORTAL(SP - newsp);
for (mark = newsp + 1; mark <= SP; mark++) {
- if (SvFLAGS(*mark) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
+ if (*mark != &PL_sv_undef
+ && SvFLAGS(*mark) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
/* Might be flattened array after $#array = */
PUTBACK;
POPSUB(cx,sv);
PL_curpm = newpm;
LEAVE;
LEAVESUB(sv);
- DIE(aTHX_ "Can't return %s from lvalue subroutine",
- (*mark != &PL_sv_undef)
- ? (SvREADONLY(TOPs)
- ? "a readonly value" : "a temporary")
- : "an uninitialized value");
+ DIE(aTHX_ "Can't return a %s from lvalue subroutine",
+ SvREADONLY(TOPs) ? "readonly value" : "temporary");
}
else {
/* Can be a localized value subject to deletion. */