summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2005-02-10 20:50:31 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2005-02-10 20:50:31 +0000
commita758b0b5fd9985d853637e2aa988519329533771 (patch)
tree13ac72625becca6611085c6ca03fe28f7bd0cfff /perly.y
parent2080282f2af44db6021d1dce04e81f0141289f86 (diff)
downloadperl-a758b0b5fd9985d853637e2aa988519329533771.tar.gz
[perl #34101] not() || 1 produces segmentation fault
Fixed by making not() behave like not(0). This is also the way not() behaved before it started segfaulting in 5.6.0. p4raw-id: //depot/perl@23960
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/perly.y b/perly.y
index 73e36ab29d..2d989b3a30 100644
--- a/perly.y
+++ b/perly.y
@@ -672,7 +672,8 @@ term : termbinop
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
scalar($1)); }
| FUNC1 '(' ')' /* not () */
- { $$ = newOP($1, OPf_SPECIAL); }
+ { $$ = $1 == OP_NOT ? newUNOP($1, 0, newSVOP(OP_CONST, 0, newSViv(0)))
+ : newOP($1, OPf_SPECIAL); }
| FUNC1 '(' expr ')' /* not($foo) */
{ $$ = newUNOP($1, 0, $3); }
| PMFUNC '(' argexpr ')' /* m//, s///, tr/// */