[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 ]
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;
}