Range overflow in array properties
Original Reporter info from Mantis: ryan_joseph @genericptr
-
Reporter name: Ryan Joseph
Original Reporter info from Mantis: ryan_joseph @genericptr
- Reporter name: Ryan Joseph
Description:
There should at least be a warning and an error if range checks are enabled.
type
TPixel = record
components: array[0..3] of byte;
property A: byte read components[10] write components[10];
end;
if the array length is a generic constant parameter the warning should be suppressed so that different combinations of properties can work with various specializations.
type
generic TPixel<const L: integer> = record
components: array[0..L - 1] of byte;
// index 10 may be valid depending on specialization so don't issue a warning
property A: byte read components[10] write components[10];
end;
Mantis conversion info:
- Mantis ID: 38829