Perl_newWHILEOP() had exactly the same lack of a NULL pointer check
Steve Peters [Sat, 11 Mar 2006 22:08:34 +0000 (22:08 +0000)]
that Perl_newLOOPOP() had and fixed in change #27476.  Maybe some
refactoring is needed?
p4raw-link: @27476 on //depot/perl: 06dc7ac6fa597f9446b4a27a32d667bbcbde0453

p4raw-id: //depot/perl@27477

op.c

diff --git a/op.c b/op.c
index 51f962a..9a5dfb1 100644 (file)
--- a/op.c
+++ b/op.c
@@ -4299,10 +4299,10 @@ whileline, OP *expr, OP *block, OP *cont, I32 has_my)
                break;
 
              case OP_SASSIGN:
-               if (k1->op_type == OP_READDIR
+               if (k1 && (k1->op_type == OP_READDIR
                      || k1->op_type == OP_GLOB
                      || (k1->op_type == OP_NULL && k1->op_targ == OP_GLOB)
-                     || k1->op_type == OP_EACH)
+                     || k1->op_type == OP_EACH))
                    expr = newUNOP(OP_DEFINED, 0, expr);
                break;
            }