Fix for [perl #37036] perl segfault at 'compile'-time
Rafael Garcia-Suarez [Wed, 31 Aug 2005 14:14:21 +0000 (14:14 +0000)]
p4raw-id: //depot/perl@25341

op.c

diff --git a/op.c b/op.c
index 4e21c7f..c0cca4e 100644 (file)
--- a/op.c
+++ b/op.c
@@ -5896,6 +5896,7 @@ Perl_ck_open(pTHX_ OP *o)
             (last->op_private & OPpCONST_STRICT) &&
             (oa = first->op_sibling) &&                /* The fh. */
             (oa = oa->op_sibling) &&                   /* The mode. */
+            (oa->op_type == OP_CONST) &&
             SvPOK(((SVOP*)oa)->op_sv) &&
             (mode = SvPVX_const(((SVOP*)oa)->op_sv)) &&
             mode[0] == '>' && mode[1] == '&' &&        /* A dup open. */