Fix change #22376. Only mark a const as short-circuited
Dave Mitchell [Thu, 1 Apr 2004 20:27:14 +0000 (20:27 +0000)]
if it's actually a const!
p4raw-link: @22376 on //depot/perl: e7fec78e344a7fdea63b9a2551a3c57cc1a50f4d

p4raw-id: //depot/perl@22635

op.c

diff --git a/op.c b/op.c
index 25db092..b38c892 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3373,7 +3373,8 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
            (type == OP_DOR && !SvOK(((SVOP*)first)->op_sv))) {
            op_free(first);
            *firstp = Nullop;
-           other->op_private |= OPpCONST_SHORTCIRCUIT;
+           if (other->op_type == OP_CONST)
+               other->op_private |= OPpCONST_SHORTCIRCUIT;
            return other;
        }
        else {
@@ -3396,7 +3397,8 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
 
            op_free(other);
            *otherp = Nullop;
-           first->op_private |= OPpCONST_SHORTCIRCUIT;
+           if (first->op_type == OP_CONST)
+               first->op_private |= OPpCONST_SHORTCIRCUIT;
            return first;
        }
     }