summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-23 05:47:55 +0000
committerZefram <zefram@fysh.org>2017-12-23 05:47:55 +0000
commitb98da25d1df8fcfc0b2bcb79d46a7624d3d98ea5 (patch)
tree2cc7f0c1dbe17b2e1f160e9eaa424608907843e3 /pp_ctl.c
parent50a85cfe6c852deb0c2f738cb82006623052dc8e (diff)
downloadperl-b98da25d1df8fcfc0b2bcb79d46a7624d3d98ea5.tar.gz
make false whereso yield undef in scalar context
Fixes [perl #132634].
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index a0cb31ccf6..a97761d999 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4616,8 +4616,11 @@ PP(pp_enterwhereso)
to the op that follows the leavewhereso.
RETURNOP calls PUTBACK which restores the stack pointer after the POPs.
*/
- if (!SvTRUEx(POPs))
+ if (!SvTRUEx(POPs)) {
+ if (gimme == G_SCALAR)
+ PUSHs(&PL_sv_undef);
RETURNOP(cLOGOP->op_other->op_next);
+ }
cx = cx_pushblock(CXt_WHERESO, gimme, SP, PL_savestack_ix);
cx_pushwhereso(cx);