mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 15:09:20 +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;
|
result:=0;
|
||||||
exit;
|
exit;
|
||||||
end;
|
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
|
begin
|
||||||
qhigh:=highrange;
|
qhigh:=highrange;
|
||||||
if lowrange=low(asizeint) then
|
if lowrange=low(asizeint) then
|
||||||
|
Loading…
Reference in New Issue
Block a user