+
+ Named_type* ntype = Type::lookup_integer_type("int");
+ Integer_type* inttype = ntype->integer_type();
+ mpz_t max;
+ mpz_init_set_ui(max, 1);
+ mpz_mul_2exp(max, max, inttype->bits() - 1);
+ bool ok = mpz_cmp(ival, max) < 0;
+ mpz_clear(max);
+ if (!ok)
+ {
+ mpz_clear(ival);
+ error_at(index_expr->location(), "index value overflow");
+ return Expression::make_error(location);
+ }
+