mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 08:09:33 +02:00
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:
parent
743d7c50d0
commit
9e7895575e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user