summaryrefslogtreecommitdiff
path: root/util/romcc
diff options
context:
space:
mode:
Diffstat (limited to 'util/romcc')
-rw-r--r--util/romcc/romcc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c
index 0c7c7e1f8e..b045b468e4 100644
--- a/util/romcc/romcc.c
+++ b/util/romcc/romcc.c
@@ -898,7 +898,7 @@ static const char *tops(int index)
if (index < 0) {
return unknown;
}
- if (index > OP_MAX) {
+ if (index >= OP_MAX) {
return unknown;
}
return table_ops[index].name;
@@ -10398,7 +10398,7 @@ static void simplify(struct compile_state *state, struct triple *ins)
do {
op = ins->op;
do_simplify = 0;
- if ((op < 0) || (op > sizeof(table_simplify)/sizeof(table_simplify[0]))) {
+ if ((op < 0) || (op >= sizeof(table_simplify)/sizeof(table_simplify[0]))) {
do_simplify = 0;
}
else {