Put back the cygwin32 Configure fix of 3582 undone by 3597.
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 8257d7d..25b17dc 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1833,8 +1833,14 @@ Perl_fold_constants(pTHX_ register OP *o)
     if (PL_opargs[type] & OA_TARGET)
        o->op_targ = pad_alloc(type, SVs_PADTMP);
 
-    if ((PL_opargs[type] & OA_OTHERINT) && (PL_hints & HINT_INTEGER))
+    /* integerize op, unless it happens to be C<-foo>.
+     * XXX should pp_i_negate() do magic string negation instead? */
+    if ((PL_opargs[type] & OA_OTHERINT) && (PL_hints & HINT_INTEGER)
+       && !(type == OP_NEGATE && cUNOPo->op_first->op_type == OP_CONST
+            && (cUNOPo->op_first->op_private & OPpCONST_BARE)))
+    {
        o->op_ppaddr = PL_ppaddr[type = ++(o->op_type)];
+    }
 
     if (!(PL_opargs[type] & OA_FOLDCONST))
        goto nope;
@@ -4993,23 +4999,27 @@ OP *
 Perl_ck_defined(pTHX_ OP *o)           /* 19990527 MJD */
 {
     dTHR;
-    if (ckWARN(WARN_DEPRECATED)) {
-      switch (cUNOPo->op_first->op_type) {
-      case OP_RV2AV:
-      case OP_PADAV:
-      case OP_AASSIGN:         /* Is this a good idea? */
-       Perl_warner(aTHX_ WARN_DEPRECATED, "defined(@array) is deprecated (and not really meaningful)");
-       Perl_warner(aTHX_ WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n");
-       break;
-      case OP_RV2HV:
-      case OP_PADHV:
-       Perl_warner(aTHX_ WARN_DEPRECATED, "defined(%hash) is deprecated (and not really meaningful)");
-       Perl_warner(aTHX_ WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n");
-       break;
-      default:
-       /* no warning */
+    if ((o->op_flags & OPf_KIDS) && ckWARN(WARN_DEPRECATED)) {
+       switch (cUNOPo->op_first->op_type) {
+       case OP_RV2AV:
+       case OP_PADAV:
+       case OP_AASSIGN:                /* Is this a good idea? */
+           Perl_warner(aTHX_ WARN_DEPRECATED,
+                       "defined(@array) is deprecated");
+           Perl_warner(aTHX_ WARN_DEPRECATED,
+                       "(Maybe you should just omit the defined()?)\n");
        break;
-      }
+       case OP_RV2HV:
+       case OP_PADHV:
+           Perl_warner(aTHX_ WARN_DEPRECATED,
+                       "defined(%hash) is deprecated");
+           Perl_warner(aTHX_ WARN_DEPRECATED,
+                       "(Maybe you should just omit the defined()?)\n");
+           break;
+       default:
+           /* no warning */
+           break;
+       }
     }
     return ck_rfun(o);
 }