On Thu, Aug 11, 2022 at 4:44 PM Martin Frb via fpc-devel <
fpc-devel@lists.freepascal.org> wrote:

> Because you are not supposed to use MaxValue
> Instead use  GetEnumNameCount
>
>      for I := MinValue to MinValue + GetEnumNameCount(...) - 1 do begin
>
> The unit name is returned because the TypeDate stores the unitname after
> the continuous list of element names. And once you are out of index ...


Damn, you are right. I fixed it better.
The MaxValue is used in many places for enum and set properties while
GetEnumNameCount() is not used anywhere.
There are other similar bugs. At least these 2 in propedits.pp look fishy:
- procedure TSetPropertyEditor.GetProperties
- subfunction IsPropInSet under function IsInteresting

OK, it was not a bug in FPC code. Sorry.

Regards,
Juha
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to