From: Chip Salzenberg Date: Fri, 9 Feb 1996 16:57:37 +0000 (-0500) Subject: Beta3/Gamma: URGENT patch for integerized comparisons [edited] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f45a1d401152a2c8202b58306cc112de4c9bafe;p=p5sagit%2Fp5-mst-13.2.git Beta3/Gamma: URGENT patch for integerized comparisons [edited] [next note is from Andy] [ This didn't apply cleanly to my source. If I delete the (int) casts in the first part of the patch, it does apply cleanly. I worry about that a little, but I put in the patch anyway. --AD ] --- diff --git a/op.c b/op.c index 6213d24..9874c28 100644 --- a/op.c +++ b/op.c @@ -1424,8 +1424,12 @@ register OP *o; if (curop->op_type == OP_PADSV || curop->op_type == OP_RV2SV) { if (vars++) return o; - if (o->op_type >= OP_LT && o->op_type <= OP_NCMP) - continue; /* allow $i < 10000 to integerize */ + if ((o->op_type == OP_LT && curop == ((BINOP*)o)->op_first) || + (o->op_type == OP_GT && curop == ((BINOP*)o)->op_last)) + { + /* Allow "$i < 100" and "100 > $i" to integerize */ + continue; + } } return o; }