Change from Larry in the MAD code which seems to be unrelated to MAD.
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index ae5c6a8..08e053a 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3561,7 +3561,9 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
 
     scalarboolean(first);
     /* optimize "!a && b" to "a || b", and "!a || b" to "a && b" */
-    if (first->op_type == OP_NOT && (first->op_flags & OPf_SPECIAL)) {
+    if (first->op_type == OP_NOT
+       && (first->op_flags & OPf_SPECIAL)
+       && (first->op_flags & OPf_KIDS)) {
        if (type == OP_AND || type == OP_OR) {
            if (type == OP_AND)
                type = OP_OR;