Changes to allow compiler with gcc-2.8.1 in C++ mode,
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 2dd64f8..73bd676 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1241,6 +1241,7 @@ mod(OP *o, I32 type)
     else if (!type) {
        o->op_private |= OPpLVAL_INTRO;
        o->op_flags &= ~OPf_SPECIAL;
+       hints |= HINT_BLOCK_SCOPE;
     }
     else if (type != OP_GREPSTART && type != OP_ENTERSUB)
        o->op_flags |= OPf_REF;
@@ -2669,7 +2670,7 @@ new_logop(I32 type, I32 flags, OP** firstp, OP** otherp)
        case OP_NULL:
            if (k2 && k2->op_type == OP_READLINE
                  && (k2->op_flags & OPf_STACKED)
-                 && ((k1->op_flags & OPf_WANT) == OPf_WANT_SCALAR)) 
+                 && (k1->op_type == OP_RV2SV || k1->op_type == OP_PADSV))
                warnop = k2->op_type;
            break;
 
@@ -2831,26 +2832,8 @@ newLOOPOP(I32 flags, I32 debuggable, OP *expr, OP *block)
            || (expr->op_type == OP_NULL && expr->op_targ == OP_GLOB)) {
            expr = newUNOP(OP_DEFINED, 0,
                newASSIGNOP(0, newDEFSVOP(), 0, expr) );
-       } else if (expr->op_flags & OPf_KIDS) {
-           OP *k1 = ((UNOP*)expr)->op_first;
-           OP *k2 = (k1) ? k1->op_sibling : NULL;
-           switch (expr->op_type) {
-             case OP_NULL: 
-               if (k2 && k2->op_type == OP_READLINE
-                     && (k2->op_flags & OPf_STACKED)
-                     && ((k1->op_flags & OPf_WANT) == OPf_WANT_SCALAR)) 
-                   expr = newUNOP(OP_DEFINED, 0, expr);
-               break;                                
-
-             case OP_SASSIGN:
-               if (k1->op_type == OP_READDIR
-                     || k1->op_type == OP_GLOB
-                     || k1->op_type == OP_EACH)
-                   expr = newUNOP(OP_DEFINED, 0, expr);
-               break;
-           }
        }
-    }           
+    }
 
     listop = append_elem(OP_LINESEQ, block, newOP(OP_UNSTACK, 0));
     o = new_logop(OP_AND, 0, &expr, &listop);
@@ -2884,27 +2867,8 @@ newWHILEOP(I32 flags, I32 debuggable, LOOP *loop, I32 whileline, OP *expr, OP *b
                 || (expr->op_type == OP_NULL && expr->op_targ == OP_GLOB))) {
        expr = newUNOP(OP_DEFINED, 0,
            newASSIGNOP(0, newDEFSVOP(), 0, expr) );
-    } else if (expr && (expr->op_flags & OPf_KIDS)) {
-       OP *k1 = ((UNOP*)expr)->op_first;
-       OP *k2 = (k1) ? k1->op_sibling : NULL;
-       switch (expr->op_type) {
-         case OP_NULL: 
-           if (k2 && k2->op_type == OP_READLINE
-                 && (k2->op_flags & OPf_STACKED)
-                 && ((k1->op_flags & OPf_WANT) == OPf_WANT_SCALAR)) 
-               expr = newUNOP(OP_DEFINED, 0, expr);
-           break;                                
-
-         case OP_SASSIGN:
-           if (k1->op_type == OP_READDIR
-                 || k1->op_type == OP_GLOB
-                 || k1->op_type == OP_EACH)
-               expr = newUNOP(OP_DEFINED, 0, expr);
-           break;
-       }
     }
 
-
     if (!block)
        block = newOP(OP_NULL, 0);