This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix for [perl #37036] perl segfault at 'compile'-time
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 31 Aug 2005 14:14:21 +0000 (14:14 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
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. */