summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorJosh ben Jore <jjore@cpan.org>2009-09-23 15:35:14 -0700
committerJosh ben Jore <jjore@cpan.org>2009-09-28 16:40:00 -0700
commit5341b2b7ab11bc31f63ac7a675e74106418d0661 (patch)
tree0e6469b5c24e455da55241aad50dab8c8cac44e3 /op.c
parent906bad61c3bd0dd3a56a226b2981e4d14d5e71c9 (diff)
downloadperl-5341b2b7ab11bc31f63ac7a675e74106418d0661.tar.gz
Fix when( scalar ... ) bug
looks_like_bool should look past scalar(). Prior to this fix, saying scalar() caused the when() argument to be /not/ a boolean even if it reasonably was. Perhaps something like: when( scalar /$re/ ). I don't know any natural way someone is doing to use when(scalar ...) but it certainly seems like it was mistakenly left out.
Diffstat (limited to 'op.c')
-rw-r--r--op.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/op.c b/op.c
index 729c25f0aa..c3736fac0b 100644
--- a/op.c
+++ b/op.c
@@ -5194,6 +5194,10 @@ S_looks_like_bool(pTHX_ const OP *o)
o->op_flags & OPf_KIDS
&& looks_like_bool(cUNOPo->op_first));
+ case OP_SCALAR:
+ return looks_like_bool(cUNOPo->op_first);
+
+
case OP_ENTERSUB:
case OP_NOT: case OP_XOR: