--- a/stage3/array_range_check.cc Thu Aug 30 13:04:30 2012 +0100
+++ b/stage3/array_range_check.cc Thu Aug 30 13:06:54 2012 +0100
@@ -133,36 +133,36 @@
/* Check lower limit */
if ( VALID_CVALUE( int64, l->elements[i]) && VALID_CVALUE( int64, dimension->lower_limit))
if ( GET_CVALUE( int64, l->elements[i]) < GET_CVALUE( int64, dimension->lower_limit) )
- {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+ {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be >= %"PRId64").", GET_CVALUE( int64, dimension->lower_limit)); continue;}
if ( VALID_CVALUE( int64, l->elements[i]) && VALID_CVALUE(uint64, dimension->lower_limit))
if ( cmp_unsigned_signed( GET_CVALUE(uint64, dimension->lower_limit), GET_CVALUE( int64, l->elements[i])) > 0 )
- {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+ {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be >= %"PRIu64").", GET_CVALUE(uint64, dimension->lower_limit)); continue;}
if ( VALID_CVALUE(uint64, l->elements[i]) && VALID_CVALUE(uint64, dimension->lower_limit))
if ( GET_CVALUE(uint64, l->elements[i]) < GET_CVALUE(uint64, dimension->lower_limit))
- {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+ {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be >= %"PRIu64").", GET_CVALUE(uint64, dimension->lower_limit)); continue;}
if ( VALID_CVALUE(uint64, l->elements[i]) && VALID_CVALUE( int64, dimension->lower_limit))
if ( cmp_unsigned_signed(GET_CVALUE(uint64, l->elements[i]), GET_CVALUE( int64, dimension->lower_limit)) < 0 )
- {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+ {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be >= %"PRId64").", GET_CVALUE( int64, dimension->lower_limit)); continue;}
/* Repeat the same check, now for upper limit */
if ( VALID_CVALUE( int64, l->elements[i]) && VALID_CVALUE( int64, dimension->upper_limit))
if ( GET_CVALUE( int64, l->elements[i]) > GET_CVALUE( int64, dimension->upper_limit))
- {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+ {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be <= %"PRId64").", GET_CVALUE( int64, dimension->upper_limit)); continue;}
if ( VALID_CVALUE( int64, l->elements[i]) && VALID_CVALUE(uint64, dimension->upper_limit))
if ( cmp_unsigned_signed( GET_CVALUE(uint64, dimension->upper_limit), GET_CVALUE( int64, l->elements[i])) < 0 )
- {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+ {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be <= %"PRIu64").", GET_CVALUE(uint64, dimension->upper_limit)); continue;}
if ( VALID_CVALUE(uint64, l->elements[i]) && VALID_CVALUE(uint64, dimension->upper_limit))
if ( GET_CVALUE(uint64, l->elements[i]) > GET_CVALUE(uint64, dimension->upper_limit))
- {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+ {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be <= %"PRIu64").", GET_CVALUE(uint64, dimension->upper_limit)); continue;}
if ( VALID_CVALUE(uint64, l->elements[i]) && VALID_CVALUE( int64, dimension->upper_limit))
if ( cmp_unsigned_signed(GET_CVALUE(uint64, l->elements[i]), GET_CVALUE( int64, dimension->upper_limit)) < 0 )
- {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds."); continue;}
+ {STAGE3_ERROR(0, symbol, symbol, "Array access out of bounds (should be <= %"PRId64").", GET_CVALUE( int64, dimension->upper_limit)); continue;}
}
}