Discussion:
[fpc-pascal] Array range overflow in properties
Ryan Joseph via fpc-pascal
2021-04-29 18:14:25 UTC
Permalink
Is this a bug in properties and I should be getting an error?

type
TPixel = record
components: array[0..3] of byte;
property R: byte read components[10] write components[10];
end;

Regards,
Ryan Joseph

_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.
Sven Barth via fpc-pascal
2021-04-30 05:22:20 UTC
Permalink
Post by Ryan Joseph via fpc-pascal
Is this a bug in properties and I should be getting an error?
type
TPixel = record
components: array[0..3] of byte;
property R: byte read components[10] write components[10];
end;
Well, there should *at least* be a warning and an error if range checks
are enabled... Please file a bug report.

Regards,
Sven
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freep
Ryan Joseph via fpc-pascal
2021-04-30 14:50:17 UTC
Permalink
Well, there should *at least* be a warning and an error if range checks are enabled... Please file a bug report.
https://bugs.freepascal.org/view.php?id=38829

Regards,
Ryan Joseph

_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal

Continue reading on narkive:
Loading...