summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorChip Salzenberg <salzench@dun.nielsen.com>1996-02-09 11:57:37 -0500
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-02-09 11:57:37 -0500
commit6f45a1d401152a2c8202b58306cc112de4c9bafe (patch)
tree44de2c9abc2b21d9667ad5eac5a4f04cd0663910 /op.c
parentb5d6801ce0a12d57fa490a927220b17df44df8a4 (diff)
downloadperl-6f45a1d401152a2c8202b58306cc112de4c9bafe.tar.gz
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 ]
Diffstat (limited to 'op.c')
-rw-r--r--op.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/op.c b/op.c
index 6213d24c70..9874c28be7 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;
}