diff options
author | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2004-04-01 06:01:25 +0000 |
---|---|---|
committer | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2004-04-01 06:01:25 +0000 |
commit | 75cc09e40ef43ffdb7866f862ed8a8f1528a2d9e (patch) | |
tree | 0ca95e03b5afc631e10a37489e8c74ffde2a8577 /op.c | |
parent | a62140726edcf5b33bdd8fed9a26ab90d77ec144 (diff) | |
download | perl-75cc09e40ef43ffdb7866f862ed8a8f1528a2d9e.tar.gz |
Fix and tests for [perl #28123] Perl optimizes // away incorrectly
p4raw-id: //depot/perl@22625
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3368,7 +3368,9 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp) no_bareword_allowed(first); else if (ckWARN(WARN_BAREWORD) && (first->op_private & OPpCONST_BARE)) Perl_warner(aTHX_ packWARN(WARN_BAREWORD), "Bareword found in conditional"); - if ((type == OP_AND) == (SvTRUE(((SVOP*)first)->op_sv))) { + if ((type == OP_AND && SvTRUE(((SVOP*)first)->op_sv)) || + (type == OP_OR && !SvTRUE(((SVOP*)first)->op_sv)) || + (type == OP_DOR && !SvOK(((SVOP*)first)->op_sv))) { op_free(first); *firstp = Nullop; other->op_private |= OPpCONST_SHORTCIRCUIT; |