Skip to content
Permalink
Browse files

Improve ABCREM on 64-bits architectures

Array indexes can be 32-bits integers even on 64-bits
architectures. This causes most loops to fail Array Bounds Checking
REMoval because the index is sign-extended before the check (see
mini_emit_ldelema_1_ins).

Sign-extending an I4 to I8 preserves its value, hence it is possible
to propagate the relation between the variables.
  • Loading branch information...
ranma42 committed Jan 1, 2014
1 parent 9288702 commit 6c0fa0d567f69e58bba4603f5b14435a7d827ab4
Showing with 6 additions and 0 deletions.
  1. +6 −0 mono/mini/abcremoval.c
@@ -275,6 +275,12 @@ get_relation_from_ins (MonoVariableRelationsEvaluationArea *area, MonoInst *ins,
value->value.variable.variable = ins->sreg1;
value->value.variable.delta = 0;
break;
case OP_SEXT_I4:
value->type = MONO_VARIABLE_SUMMARIZED_VALUE;
value->value.variable.variable = ins->sreg1;
value->value.variable.delta = 0;
value_kind = MONO_INTEGER_VALUE_SIZE_8;
break;
case OP_PHI:
value->type = MONO_PHI_SUMMARIZED_VALUE;
value->value.phi.number_of_alternatives = *(ins->inst_phi_args);

0 comments on commit 6c0fa0d

Please sign in to comment.
You can’t perform that action at this time.