tarraydef.elecount: fix overflow detection

It did not trigger in case of an array[0..high(asizeint)]. Fixes compilation
of webtbs/tw9039[ab] with a compiler built with range checking enabled.
This commit is contained in:
Jonas Maebe 2022-05-29 11:27:22 +02:00
parent 743d7c50d0
commit 9e7895575e

View File

@ -4469,7 +4469,9 @@ implementation
result:=0;
exit;
end;
if (highrange>0) and (lowrange<0) then
{ check whether the range might be larger than high(asizeint). Has
to include 0..high(sizeint), since that's high(sizeint)+1 elements }
if (highrange>=0) and (lowrange<=0) then
begin
qhigh:=highrange;
if lowrange=low(asizeint) then